diff --git a/tests/TestCase/ORM/TableTest.php b/tests/TestCase/ORM/TableTest.php index c388dee4bb5..7821eba60f6 100644 --- a/tests/TestCase/ORM/TableTest.php +++ b/tests/TestCase/ORM/TableTest.php @@ -6507,15 +6507,13 @@ public function testSaveOrFail() { $this->expectException(\Cake\ORM\Exception\PersistenceFailedException::class); $this->expectExceptionMessage('Entity save failure.'); + $entity = new Entity([ 'foo' => 'bar' ]); $table = TableRegistry::get('users'); $table->saveOrFail($entity); - - $row = $table->find('all')->where(['foo' => 'bar'])->toArray(); - $this->assertSame([], $row->toArray()); } /** @@ -6527,6 +6525,7 @@ public function testSaveOrFailErrorDisplay() { $this->expectException(\Cake\ORM\Exception\PersistenceFailedException::class); $this->expectExceptionMessage('Entity save failure (field: "Some message", multiple: "one, two")'); + $entity = new Entity([ 'foo' => 'bar' ]); @@ -6535,9 +6534,6 @@ public function testSaveOrFailErrorDisplay() $table = TableRegistry::get('users'); $table->saveOrFail($entity); - - $row = $table->find('all')->where(['foo' => 'bar'])->toArray(); - $this->assertSame([], $row->toArray()); } /**