Browse Source

Simplify error message and test.

mark_story 11 years ago
parent
commit
94e52ff182
2 changed files with 4 additions and 8 deletions
  1. 3 7
      src/ORM/Query.php
  2. 1 1
      tests/TestCase/ORM/TableTest.php

+ 3 - 7
src/ORM/Query.php

@@ -837,7 +837,7 @@ class Query extends DatabaseQuery implements JsonSerializable {
 	}
 
 /**
- * Get the first result from the executing query or raist an exception.
+ * Get the first result from the executing query or raise an exception.
  *
  * @throws \Cake\ORM\RecordNotFoundException When there is no first record.
  * @return mixed The first result from the ResultSet.
@@ -847,13 +847,9 @@ class Query extends DatabaseQuery implements JsonSerializable {
 		if ($entity) {
 			return $entity;
 		}
-		$binder = new ValueBinder();
-		$conditions = $this->clause('where');
-
 		throw new RecordNotFoundException(sprintf(
-			'Record not found in table "%s" for conditions "%s"',
-			$this->repository()->table(),
-			$conditions->sql($binder)
+			'Record not found in table "%s"',
+			$this->repository()->table()
 		));
 	}
 

+ 1 - 1
tests/TestCase/ORM/TableTest.php

@@ -3476,7 +3476,7 @@ class TableTest extends TestCase {
  * Tests that get() will throw an exception if the record was not found
  *
  * @expectedException \Cake\ORM\Exception\RecordNotFoundException
- * @expectedExceptionMessage Record not found in table "articles" for conditions "articles.id = :c0"
+ * @expectedExceptionMessage Record not found in table "articles"
  * @return void
  */
 	public function testGetNotFoundException() {