Skip to content
Permalink
Browse files

Removing the useless string callback from the findOrCreate

  • Loading branch information...
burzum committed Apr 25, 2016
1 parent 656adb7 commit 8b3676974e2ef57da8c4389fb5abb00f8f9a8689
Showing with 0 additions and 17 deletions.
  1. +0 −6 src/ORM/Table.php
  2. +0 −11 tests/TestCase/ORM/TableTest.php
@@ -1245,12 +1245,6 @@ protected function _getFindOrCreateQuery($search)
if ($search instanceof Query) {
return $search;
}
if (is_string($search)) {
if (method_exists($this, $search)) {
return $this->{$search}();
}
throw new InvalidArgumentException('Method `' . $search . '` does not exist!');
}
return $this->find()->where($search);
}
@@ -5390,17 +5390,6 @@ function ($article) {
$this->assertEquals(2, $article->author_id);
}
/**
* Test that exceptions from the findOrCreate are thrown.
*
* @expectedException \InvalidArgumentException
*/
public function testFindOrCreateException()
{
$articles = TableRegistry::get('Articles');
$articles->findOrCreate('doesNotExist');
}
/**
* Test that creating a table fires the initialize event.
*

0 comments on commit 8b36769

Please sign in to comment.
You can’t perform that action at this time.