Skip to content

Commit 63907c1

Browse files
committed
[phalcon/incubator#973] Add test cases
1 parent fc8f655 commit 63907c1

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/Mvc/Collection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,6 @@ public function unserialize($data): void
12441244
* Gets the default collectionsManager service
12451245
*/
12461246
$manager = $container->getShared("collectionManager");
1247-
12481247
if ($manager === null) {
12491248
throw new Exception(
12501249
"The injected service 'collectionManager' is not valid"

tests/integration/Collection/AggregateCest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Phalcon\Incubator\MongoDB\Mvc\Collection\Exception;
2020
use Phalcon\Incubator\MongoDB\Test\Fixtures\Mvc\Collections\Robots;
2121
use Phalcon\Incubator\MongoDB\Test\Fixtures\Traits\DiTrait;
22+
use Traversable;
2223

2324
class AggregateCest
2425
{
@@ -69,12 +70,13 @@ public function mvcCollectionAggregate(IntegrationTester $I)
6970
$robots1 = Robots::aggregate([
7071
[
7172
'$match' => [
72-
'first_name' => 'Wall'
73+
'first_name' => 'Wall',
7374
]
7475
]
7576
]);
7677

7778
$I->assertInstanceOf(Cursor::class, $robots1);
79+
$I->assertInstanceOf(Traversable::class, $robots1);
7880

7981
foreach ($robots1 as $rb) {
8082
$I->assertIsArray($rb);

tests/integration/Collection/FindCest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Phalcon\Incubator\MongoDB\Mvc\Collection\Exception;
1919
use Phalcon\Incubator\MongoDB\Test\Fixtures\Mvc\Collections\Robots;
2020
use Phalcon\Incubator\MongoDB\Test\Fixtures\Traits\DiTrait;
21+
use Traversable;
2122

2223
class FindCest
2324
{
@@ -77,7 +78,9 @@ public function mvcCollectionFind(IntegrationTester $I)
7778
}
7879

7980
$I->assertNotEmpty($robots);
81+
$I->assertInstanceOf(Traversable::class, $robots);
8082
$I->assertInstanceOf(Robots::class, $result[0]);
83+
$I->assertInstanceOf(Traversable::class, $robotsE);
8184
$I->assertCount(3, $result);
8285
$I->assertCount(2, $robotsE->toArray());
8386
}

0 commit comments

Comments
 (0)