Add in/inArray; expand Field ctr func names
This commit is contained in:
@@ -54,14 +54,14 @@ class PatchTest extends TestCase
|
||||
|
||||
public function testByFieldsSucceedsWhenADocumentIsUpdated(): void
|
||||
{
|
||||
Patch::byFields(ThrowawayDb::TABLE, [Field::EQ('value', 'purple')], ['num_value' => 77]);
|
||||
$after = Count::byFields(ThrowawayDb::TABLE, [Field::EQ('num_value', 77)]);
|
||||
Patch::byFields(ThrowawayDb::TABLE, [Field::equal('value', 'purple')], ['num_value' => 77]);
|
||||
$after = Count::byFields(ThrowawayDb::TABLE, [Field::equal('num_value', 77)]);
|
||||
$this->assertEquals(2, $after, 'There should have been 2 documents updated');
|
||||
}
|
||||
|
||||
public function testByFieldsSucceedsWhenNoDocumentIsUpdated(): void
|
||||
{
|
||||
$fields = [Field::EQ('value', 'burgundy')];
|
||||
$fields = [Field::equal('value', 'burgundy')];
|
||||
$this->assertEquals(0, Count::byFields(ThrowawayDb::TABLE, $fields), 'There should be no matching documents');
|
||||
Patch::byFields(ThrowawayDb::TABLE, $fields, ['foo' => 'green']);
|
||||
$this->assertTrue(true, 'The above not throwing an exception is the test');
|
||||
|
||||
Reference in New Issue
Block a user