1
0
mirror of synced 2025-02-02 21:41:45 +03:00

#6284 adding assertions about equality of the loaded classes

This commit is contained in:
Marco Pivetta 2017-08-22 21:27:46 +02:00
parent dac1ce4172
commit 6f6e88cfb6
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629

View File

@ -36,14 +36,20 @@ final class GH6217Test extends OrmFunctionalTestCase
$this->_em->clear();
$repository = $this->_em->getRepository(GH6217UserProfile::class);
$filters = ['user' => $user->id, 'category' => $category->id];
$filters = ['category' => $category->id];
$this->assertCount(1, $repository->findBy($filters));
$queryCount = $this->getCurrentQueryCount();
$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());
}
}