Skip to content

Commit

Permalink
Added NoDataType test.
Browse files Browse the repository at this point in the history
Fixed some unit tests to use mocks instead of foreign classes.
  • Loading branch information
Bilge committed Jun 17, 2016
1 parent abc3c7e commit cd13ed1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace ScriptFUSIONTest\Unit\Porter\Collection;
namespace ScriptFUSIONTest\Integration\Porter\Collection;

use ScriptFUSION\Porter\Collection\CountableProviderRecords;
use ScriptFUSION\Porter\Provider\ProviderDataType;
Expand Down
5 changes: 4 additions & 1 deletion test/Unit/Porter/Collection/ProviderRecordsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ final class ProviderRecordsTest extends \PHPUnit_Framework_TestCase
{
public function test()
{
$records = new ProviderRecords(new \EmptyIterator, $providerDataType = \Mockery::mock(ProviderDataType::class));
$records = new ProviderRecords(
\Mockery::mock(\Iterator::class),
$providerDataType = \Mockery::mock(ProviderDataType::class)
);

self::assertSame($providerDataType, $records->getProviderData());
}
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/Porter/Collection/RecordCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function testFindParent()
$collection3 = \Mockery::mock(
RecordCollection::class,
[
$it = new \EmptyIterator,
$it = \Mockery::mock(\Iterator::class),
$collection2 = \Mockery::mock(
RecordCollection::class,
[
Expand Down
13 changes: 13 additions & 0 deletions test/Unit/Porter/Provider/NoDataTypeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
namespace ScriptFUSIONTest\Unit\Porter\Provider;

use ScriptFUSION\Porter\Connector\Connector;
use ScriptFUSION\Porter\Provider\NoDataType;

final class NoDataTypeTest extends \PHPUnit_Framework_TestCase
{
public function test()
{
self::assertFalse((new NoDataType)->fetch(\Mockery::mock(Connector::class))->valid());
}
}

0 comments on commit cd13ed1

Please sign in to comment.