diff --git a/tests/TestCase/ORM/QueryTest.php b/tests/TestCase/ORM/QueryTest.php index 6e772a18fb0..b59ee0f735c 100644 --- a/tests/TestCase/ORM/QueryTest.php +++ b/tests/TestCase/ORM/QueryTest.php @@ -3614,7 +3614,6 @@ public function testSelectAllExcept() public function testSelectAllExceptWithContains() { $table = $this->getTableLocator()->get('Articles'); - $this->getTableLocator()->get('Articles'); $table->hasMany('Comments'); $table->belongsTo('Authors'); @@ -3642,7 +3641,6 @@ public function testSelectAllExceptWithContains() public function testSelectAllExceptWithMulitpleCalls() { $table = $this->getTableLocator()->get('Articles'); - $this->getTableLocator()->get('Articles'); $result = $table ->find() @@ -3692,12 +3690,9 @@ public function testSelectAllExceptWithMulitpleCalls() public function testSelectAllExceptThrowsInvalidArgument() { $table = $this->getTableLocator()->get('Articles'); - try { + $this->expectException(\InvalidArgumentException::class); $table ->find() ->selectAllExcept([], ['body']); - } catch (\InvalidArgumentException $e) { - $this->assertTrue(true); - } } }