Skip to content

Commit

Permalink
#6613 #6614 #6616 removing repeated PersistentCollectionTest chunk…
Browse files Browse the repository at this point in the history
…s of code
  • Loading branch information
Ocramius committed Aug 11, 2017
1 parent d6bcb5b commit 61cb03b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions tests/Doctrine/Tests/ORM/PersistentCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ protected function setUp()
parent::setUp();

$this->_emMock = EntityManagerMock::create(new ConnectionMock([], new DriverMock()));

$this->setUpPersistentCollection();
}

/**
Expand All @@ -60,7 +62,6 @@ public function testCanBePutInLazyLoadingMode()
*/
public function testCurrentInitializesCollection()
{
$this->setUpPersistentCollection();
$this->collection->current();
$this->assertTrue($this->collection->isInitialized());
}
Expand All @@ -70,7 +71,6 @@ public function testCurrentInitializesCollection()
*/
public function testKeyInitializesCollection()
{
$this->setUpPersistentCollection();
$this->collection->key();
$this->assertTrue($this->collection->isInitialized());
}
Expand All @@ -80,7 +80,6 @@ public function testKeyInitializesCollection()
*/
public function testNextInitializesCollection()
{
$this->setUpPersistentCollection();
$this->collection->next();
$this->assertTrue($this->collection->isInitialized());
}
Expand All @@ -90,8 +89,6 @@ public function testNextInitializesCollection()
*/
public function testRemovingElementsAlsoRemovesKeys()
{
$this->setUpPersistentCollection();

$dummy = new \stdClass();

$this->collection->add($dummy);
Expand All @@ -106,8 +103,6 @@ public function testRemovingElementsAlsoRemovesKeys()
*/
public function testClearWillAlsoClearKeys()
{
$this->setUpPersistentCollection();

$this->collection->add(new \stdClass());
$this->collection->clear();
$this->assertEquals([], array_keys($this->collection->toArray()));
Expand All @@ -118,8 +113,6 @@ public function testClearWillAlsoClearKeys()
*/
public function testClearWillAlsoResetKeyPositions()
{
$this->setUpPersistentCollection();

$dummy = new \stdClass();

$this->collection->add($dummy);
Expand All @@ -141,8 +134,6 @@ public function testWillKeepNewItemsInDirtyCollectionAfterInitialization()

$this->_emMock->setUnitOfWork($unitOfWork);

$this->setUpPersistentCollection();

$newElement = new \stdClass();
$persistedElement = new \stdClass();

Expand Down Expand Up @@ -178,8 +169,6 @@ public function testWillDeDuplicateNewItemsThatWerePreviouslyPersistedInDirtyCol

$this->_emMock->setUnitOfWork($unitOfWork);

$this->setUpPersistentCollection();

$newElement = new \stdClass();
$newElementThatIsAlsoPersisted = new \stdClass();
$persistedElement = new \stdClass();
Expand Down

0 comments on commit 61cb03b

Please sign in to comment.