Skip to content

Commit

Permalink
Rename test methods for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Nov 24, 2023
1 parent 5dcd722 commit 829557c
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function tearDown(): void
parent::tearDown();
}

public function testErrorDuringInsertKeepsFailingInsertions(): void
public function testInsertErrorKeepsFailingInsertions(): void
{
$firstUser = new ForumUser();
$firstUser->username = 'alcaeus';
Expand Down Expand Up @@ -69,7 +69,7 @@ public function testErrorDuringInsertKeepsFailingInsertions(): void
self::assertNotEquals([], $this->uow->getDocumentChangeSet($friendUser));
}

public function testErrorDuringInsertKeepsFailingInsertionsForDocument(): void
public function testInsertErrorKeepsFailingInsertionsForDocumentClass(): void
{
// Create a unique index on the collection to let the second insert fail
$collection = $this->dm->getDocumentCollection(ForumUser::class);
Expand Down Expand Up @@ -111,7 +111,7 @@ public function testErrorDuringInsertKeepsFailingInsertionsForDocument(): void
self::assertNotEquals([], $this->uow->getDocumentChangeSet($thirdUser));
}

public function testErrorDuringInsertWithEmbeddedDocumentKeepsInsertions(): void
public function testInsertErrorWithEmbeddedDocumentKeepsInsertions(): void
{
// Create a unique index on the collection to let the second insert fail
$collection = $this->dm->getDocumentCollection(User::class);
Expand Down Expand Up @@ -155,7 +155,7 @@ public function testErrorDuringInsertWithEmbeddedDocumentKeepsInsertions(): void
$this->assertNotEquals([], $this->uow->getDocumentChangeSet($secondAddress));
}

public function testErrorDuringUpsertDropsFailingUpserts(): void
public function testUpsertErrorDropsFailingUpserts(): void
{
$user = new ForumUser();
$user->id = new ObjectId(); // Specifying an identifier makes this an upsert
Expand Down Expand Up @@ -187,7 +187,7 @@ public function testErrorDuringUpsertDropsFailingUpserts(): void
self::assertNotEquals([], $this->uow->getDocumentChangeSet($user));
}

public function testErrorDuringUpdateKeepsFailingUpdate(): void
public function testUpdateErrorKeepsFailingUpdate(): void
{
$user = new ForumUser();
$user->username = 'alcaeus';
Expand Down Expand Up @@ -222,7 +222,7 @@ public function testErrorDuringUpdateKeepsFailingUpdate(): void
self::assertNotEquals([], $this->uow->getDocumentChangeSet($user));
}

public function testErrorDuringUpdateWithNewEmbeddedDocumentKeepsFailingChangeset(): void
public function testUpdateErrorWithNewEmbeddedDocumentKeepsFailingChangeset(): void
{
$user = new User();
$user->setUsername('alcaeus');
Expand Down Expand Up @@ -255,7 +255,7 @@ public function testErrorDuringUpdateWithNewEmbeddedDocumentKeepsFailingChangese
$this->assertNotEquals([], $this->uow->getDocumentChangeSet($address));
}

public function testSuccessfulUpdateWithNewEmbeddedDocumentClearsChangesets(): void
public function testUpdateWithNewEmbeddedDocumentClearsChangesets(): void
{
$user = new User();
$user->setUsername('alcaeus');
Expand All @@ -275,7 +275,7 @@ public function testSuccessfulUpdateWithNewEmbeddedDocumentClearsChangesets(): v
$this->assertEquals([], $this->uow->getDocumentChangeSet($address));
}

public function testErrorDuringUpdateOfEmbeddedDocumentKeepsFailingChangeset(): void
public function testUpdateErrorWithEmbeddedDocumentKeepsFailingChangeset(): void
{
$address = new Address();
$address->setCity('Olching');
Expand Down Expand Up @@ -310,7 +310,7 @@ public function testErrorDuringUpdateOfEmbeddedDocumentKeepsFailingChangeset():
$this->assertNotEquals([], $this->uow->getDocumentChangeSet($address));
}

public function testSuccessfulUpdateOfEmbeddedDocumentClearsChangesets(): void
public function testUpdateWithEmbeddedDocumentClearsChangesets(): void
{
$address = new Address();
$address->setCity('Olching');
Expand All @@ -332,7 +332,7 @@ public function testSuccessfulUpdateOfEmbeddedDocumentClearsChangesets(): void
$this->assertEquals([], $this->uow->getDocumentChangeSet($address));
}

public function testErrorDuringUpdateWithRemovedEmbeddedDocumentKeepsFailingChangeset(): void
public function testUpdateErrorWithRemovedEmbeddedDocumentKeepsFailingChangeset(): void
{
$address = new Address();
$address->setCity('Olching');
Expand Down Expand Up @@ -369,7 +369,7 @@ public function testErrorDuringUpdateWithRemovedEmbeddedDocumentKeepsFailingChan
$this->assertFalse($this->uow->isInIdentityMap($address));
}

public function testSuccessfulUpdateWithRemovedEmbeddedDocumentClearsChangesets(): void
public function testUpdateWithRemovedEmbeddedDocumentClearsChangesets(): void
{
$address = new Address();
$address->setCity('Olching');
Expand All @@ -391,7 +391,7 @@ public function testSuccessfulUpdateWithRemovedEmbeddedDocumentClearsChangesets(
$this->assertFalse($this->uow->isInIdentityMap($address));
}

public function testErrorDuringDeleteKeepsFailingDelete(): void
public function testDeleteErrorKeepsFailingDelete(): void
{
$user = new ForumUser();
$user->username = 'alcaeus';
Expand Down Expand Up @@ -425,7 +425,7 @@ public function testErrorDuringDeleteKeepsFailingDelete(): void
self::assertTrue($this->uow->isScheduledForDelete($user));
}

public function testFailingDeleteWithEmbeddedDocumentKeepsChangeset(): void
public function testDeleteErrorWithEmbeddedDocumentKeepsChangeset(): void
{
$address = new Address();
$address->setCity('Olching');
Expand Down Expand Up @@ -465,7 +465,7 @@ public function testFailingDeleteWithEmbeddedDocumentKeepsChangeset(): void
self::assertTrue($this->uow->isScheduledForDelete($address));
}

public function testSuccessfulDeleteWithEmbeddedDocumentClearsChangeset(): void
public function testDeleteWithEmbeddedDocumentClearsChangeset(): void
{
$address = new Address();
$address->setCity('Olching');
Expand Down

0 comments on commit 829557c

Please sign in to comment.