#6284 simplifying tests to a minimum, removing unused auto-generated id field
This commit is contained in:
parent
c7281f6ade
commit
3842ad8ea1
@ -26,9 +26,9 @@ final class GH6217Test extends OrmFunctionalTestCase
|
|||||||
*/
|
*/
|
||||||
public function testRetrievingCacheShouldNotThrowUndefinedIndexException()
|
public function testRetrievingCacheShouldNotThrowUndefinedIndexException()
|
||||||
{
|
{
|
||||||
$user = new GH6217User(1);
|
$user = new GH6217User();
|
||||||
$profile = new GH6217Profile();
|
$profile = new GH6217Profile();
|
||||||
$category = new GH6217Category(1);
|
$category = new GH6217Category();
|
||||||
$userProfile = new GH6217UserProfile($user, $profile, $category);
|
$userProfile = new GH6217UserProfile($user, $profile, $category);
|
||||||
|
|
||||||
$this->_em->persist($category);
|
$this->_em->persist($category);
|
||||||
@ -39,7 +39,7 @@ 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' => 1, 'category' => 1];
|
$filters = ['user' => $user->id, 'category' => $category->id];
|
||||||
|
|
||||||
$this->assertCount(1, $repository->findBy($filters));
|
$this->assertCount(1, $repository->findBy($filters));
|
||||||
$queryCount = $this->getCurrentQueryCount();
|
$queryCount = $this->getCurrentQueryCount();
|
||||||
@ -59,15 +59,16 @@ class GH6217User
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @Id
|
* @Id
|
||||||
* @Column(type="integer")
|
* @Column(type="string")
|
||||||
|
* @GeneratedValue(strategy="NONE")
|
||||||
*
|
*
|
||||||
* @var int
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
public function __construct(int $id)
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = uniqid(self::class, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,15 +98,16 @@ class GH6217Category
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @Id
|
* @Id
|
||||||
* @Column(type="integer")
|
* @Column(type="string")
|
||||||
|
* @GeneratedValue(strategy="NONE")
|
||||||
*
|
*
|
||||||
* @var int
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
public function __construct(int $id)
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = uniqid(self::class, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +121,6 @@ class GH6217UserProfile
|
|||||||
* @Id
|
* @Id
|
||||||
* @Cache("NONSTRICT_READ_WRITE")
|
* @Cache("NONSTRICT_READ_WRITE")
|
||||||
* @ManyToOne(targetEntity="GH6217User")
|
* @ManyToOne(targetEntity="GH6217User")
|
||||||
* @JoinColumn(nullable=false)
|
|
||||||
*
|
*
|
||||||
* @var GH6217User
|
* @var GH6217User
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user