Update testdox for integration tests

This commit is contained in:
2024-09-22 22:13:51 -04:00
parent 91bf3128c5
commit 9a2cf4c204
20 changed files with 192 additions and 75 deletions

View File

@@ -34,7 +34,7 @@ class PatchTest extends TestCase
parent::tearDown();
}
#[TestDox('By ID succeeds when a document is updated')]
#[TestDox('byId() succeeds when a document is updated')]
public function testByIdSucceedsWhenADocumentIsUpdated(): void
{
Patch::byId(ThrowawayDb::TABLE, 'one', ['num_value' => 44]);
@@ -43,13 +43,14 @@ class PatchTest extends TestCase
$this->assertEquals(44, $doc->get()->num_value, 'The updated document is not correct');
}
#[TestDox('By ID succeeds when no document is updated')]
#[TestDox('byId() succeeds when no document is updated')]
public function testByIdSucceedsWhenNoDocumentIsUpdated(): void
{
Patch::byId(ThrowawayDb::TABLE, 'forty-seven', ['foo' => 'green']);
$this->assertTrue(true, 'The above not throwing an exception is the test');
}
#[TestDox('byFields() succeeds when a document is updated')]
public function testByFieldsSucceedsWhenADocumentIsUpdated(): void
{
Patch::byFields(ThrowawayDb::TABLE, [Field::equal('value', 'purple')], ['num_value' => 77]);
@@ -57,19 +58,21 @@ class PatchTest extends TestCase
$this->assertEquals(2, $after, 'There should have been 2 documents updated');
}
#[TestDox('byFields() succeeds when no document is updated')]
public function testByFieldsSucceedsWhenNoDocumentIsUpdated(): void
{
Patch::byFields(ThrowawayDb::TABLE, [Field::equal('value', 'burgundy')], ['foo' => 'green']);
$this->assertTrue(true, 'The above not throwing an exception is the test');
}
#[TestDox('byContains() fails')]
public function testByContainsFails(): void
{
$this->expectException(DocumentException::class);
Patch::byContains('', [], []);
}
#[TestDox('By JSON Path fails')]
#[TestDox('byJsonPath() fails')]
public function testByJsonPathFails(): void
{
$this->expectException(DocumentException::class);