#6284 adding assertions about equality of the loaded classes
This commit is contained in:
parent
dac1ce4172
commit
6f6e88cfb6
@ -36,14 +36,20 @@ final class GH6217Test extends OrmFunctionalTestCase
|
|||||||
$this->_em->clear();
|
$this->_em->clear();
|
||||||
|
|
||||||
$repository = $this->_em->getRepository(GH6217UserProfile::class);
|
$repository = $this->_em->getRepository(GH6217UserProfile::class);
|
||||||
$filters = ['user' => $user->id, 'category' => $category->id];
|
$filters = ['category' => $category->id];
|
||||||
|
|
||||||
$this->assertCount(1, $repository->findBy($filters));
|
$this->assertCount(1, $repository->findBy($filters));
|
||||||
$queryCount = $this->getCurrentQueryCount();
|
$queryCount = $this->getCurrentQueryCount();
|
||||||
|
|
||||||
$this->_em->clear();
|
$this->_em->clear();
|
||||||
|
|
||||||
$this->assertCount(1, $repository->findBy($filters));
|
/* @var $found GH6217UserProfile[] */
|
||||||
|
$found = $repository->findBy($filters);
|
||||||
|
|
||||||
|
$this->assertCount(1, $found);
|
||||||
|
$this->assertInstanceOf(GH6217UserProfile::class, $found[0]);
|
||||||
|
$this->assertSame($user->id, $found[0]->user->id);
|
||||||
|
$this->assertSame($category->id, $found[0]->category->id);
|
||||||
$this->assertEquals($queryCount, $this->getCurrentQueryCount());
|
$this->assertEquals($queryCount, $this->getCurrentQueryCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user