Browse Source

Fixed broken tests

Jose Lorenzo Rodriguez 11 years ago
parent
commit
0c2f4669ab

+ 1 - 1
src/Datasource/QueryTrait.php

@@ -414,7 +414,7 @@ trait QueryTrait {
 		}
 
 		if ($this->bufferResults()) {
-			$result = $result->buffered();
+			$result = new $decorator($result->buffered());
 		}
 
 		return $result;

+ 3 - 3
tests/TestCase/Controller/ControllerTest.php

@@ -660,10 +660,10 @@ class ControllerTest extends TestCase {
 		$this->assertArrayNotHasKey('Paginator', $Controller->helpers);
 
 		$results = $Controller->paginate('Posts');
-		$this->assertInstanceOf('Cake\ORM\ResultSet', $results);
+		$this->assertInstanceOf('Cake\Datasource\ResultSetDecorator', $results);
 
 		$results = $Controller->paginate(TableRegistry::get('Posts'));
-		$this->assertInstanceOf('Cake\ORM\ResultSet', $results);
+		$this->assertInstanceOf('Cake\Datasource\ResultSetDecorator', $results);
 
 		$this->assertSame($Controller->request->params['paging']['Posts']['page'], 1);
 		$this->assertSame($Controller->request->params['paging']['Posts']['pageCount'], 1);
@@ -686,7 +686,7 @@ class ControllerTest extends TestCase {
 		$Controller->modelClass = 'Posts';
 		$results = $Controller->paginate();
 
-		$this->assertInstanceOf('Cake\ORM\ResultSet', $results);
+		$this->assertInstanceOf('Cake\Datasource\ResultSetDecorator', $results);
 	}
 
 /**

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

@@ -1537,7 +1537,7 @@ class QueryTest extends TestCase {
 			->method('write')
 			->with(
 				'my_key',
-				$this->isInstanceOf('Cake\ORM\ResultSet')
+				$this->isInstanceOf('Cake\Datasource\ResultSetDecorator')
 			);
 
 		$query->cache('my_key', $cacher)