Skip to content

Commit 25307fe

Browse files
committed
more tests
1 parent d9ab06d commit 25307fe

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

tests/Annotated/Fixtures/Simple.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Simple implements LabelledInterface
3434
protected $one;
3535

3636
/**
37-
* @HasMany(target="WithTable")
37+
* @HasMany(target="WithTable", where={"id": {">": 1}})
3838
* @var WithTable[]|Collection
3939
*/
4040
protected $many;

tests/Annotated/Relation/HasManyTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use Cycle\Schema\Generator\ResetTables;
2323
use Cycle\Schema\Generator\SyncTables;
2424
use Cycle\Schema\Registry;
25-
use Cycle\Schema\Relation\HasMany as HasManyRelation;
2625

2726
abstract class HasManyTest extends BaseTest
2827
{
@@ -45,5 +44,9 @@ public function testRelation()
4544
$this->assertArrayHasKey('many', $schema['simple'][Schema::RELATIONS]);
4645
$this->assertSame(Relation::HAS_MANY, $schema['simple'][Schema::RELATIONS]['many'][Relation::TYPE]);
4746
$this->assertSame("withTable", $schema['simple'][Schema::RELATIONS]['many'][Relation::TARGET]);
47+
48+
$this->assertSame([
49+
'id' => ['>' => 1]
50+
], $schema['simple'][Schema::RELATIONS]['many'][Relation::SCHEMA][Relation::WHERE]);
4851
}
4952
}

0 commit comments

Comments
 (0)