Skip to content

Commit

Permalink
Use TableLocator instead of TableRegistry in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpustulka committed Sep 21, 2017
1 parent edfeaa5 commit 684c121
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions tests/Fixture/FixturizedTestCase.php
@@ -1,7 +1,6 @@
<?php
namespace Cake\Test\Fixture;

use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;
use Exception;

Expand Down Expand Up @@ -45,9 +44,9 @@ public function testFixtureLoadOnDemand()
public function testLoadAllFixtures()
{
$this->loadFixtures();
$article = TableRegistry::get('Articles')->get(1);
$article = $this->getTableLocator()->get('Articles')->get(1);
$this->assertSame(1, $article->id);
$category = TableRegistry::get('Categories')->get(1);
$category = $this->getTableLocator()->get('Categories')->get(1);
$this->assertSame(1, $category->id);
}

Expand Down
Expand Up @@ -686,7 +686,7 @@ public function testEmptyPaginationResult()
{
$this->loadFixtures('Posts');

$table = TableRegistry::get('PaginatorPosts');
$table = $this->getTableLocator()->get('PaginatorPosts');
$table->deleteAll('1=1');

$this->Paginator->paginate($table);
Expand Down Expand Up @@ -742,7 +742,7 @@ public function testOutOfRangePageNumberStillProvidesPageCount()
$this->request->query['limit'] = 1;
$this->request->query['page'] = 4;

$table = TableRegistry::get('PaginatorPosts');
$table = $this->getTableLocator()->get('PaginatorPosts');
try {
$this->Paginator->paginate($table);
$this->fail('No exception raised');
Expand Down

0 comments on commit 684c121

Please sign in to comment.