|
|
@@ -73,12 +73,14 @@ class TableRegistryTest extends TestCase
|
|
|
*/
|
|
|
public function testLocator()
|
|
|
{
|
|
|
- $this->assertInstanceOf('Cake\ORM\Locator\LocatorInterface', TableRegistry::locator());
|
|
|
+ $this->deprecated(function () {
|
|
|
+ $this->assertInstanceOf('Cake\ORM\Locator\LocatorInterface', TableRegistry::locator());
|
|
|
|
|
|
- $locator = $this->getMockBuilder('Cake\ORM\Locator\LocatorInterface')->getMock();
|
|
|
- TableRegistry::locator($locator);
|
|
|
+ $locator = $this->getMockBuilder('Cake\ORM\Locator\LocatorInterface')->getMock();
|
|
|
+ TableRegistry::locator($locator);
|
|
|
|
|
|
- $this->assertSame($locator, TableRegistry::locator());
|
|
|
+ $this->assertSame($locator, TableRegistry::locator());
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -121,10 +123,12 @@ class TableRegistryTest extends TestCase
|
|
|
*/
|
|
|
public function testConfig()
|
|
|
{
|
|
|
- $locator = $this->_setMockLocator();
|
|
|
- $locator->expects($this->once())->method('config')->with('Test', []);
|
|
|
+ $this->deprecated(function () {
|
|
|
+ $locator = $this->_setMockLocator();
|
|
|
+ $locator->expects($this->once())->method('config')->with('Test', []);
|
|
|
|
|
|
- TableRegistry::config('Test', []);
|
|
|
+ TableRegistry::config('Test', []);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -134,10 +138,12 @@ class TableRegistryTest extends TestCase
|
|
|
*/
|
|
|
public function testGet()
|
|
|
{
|
|
|
- $locator = $this->_setMockLocator();
|
|
|
- $locator->expects($this->once())->method('get')->with('Test', []);
|
|
|
+ $this->deprecated(function () {
|
|
|
+ $locator = $this->_setMockLocator();
|
|
|
+ $locator->expects($this->once())->method('get')->with('Test', []);
|
|
|
|
|
|
- TableRegistry::get('Test', []);
|
|
|
+ TableRegistry::get('Test', []);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -147,12 +153,14 @@ class TableRegistryTest extends TestCase
|
|
|
*/
|
|
|
public function testSet()
|
|
|
{
|
|
|
- $table = $this->getMockBuilder('Cake\ORM\Table')->getMock();
|
|
|
+ $this->deprecated(function () {
|
|
|
+ $table = $this->getMockBuilder('Cake\ORM\Table')->getMock();
|
|
|
|
|
|
- $locator = $this->_setMockLocator();
|
|
|
- $locator->expects($this->once())->method('set')->with('Test', $table);
|
|
|
+ $locator = $this->_setMockLocator();
|
|
|
+ $locator->expects($this->once())->method('set')->with('Test', $table);
|
|
|
|
|
|
- TableRegistry::set('Test', $table);
|
|
|
+ TableRegistry::set('Test', $table);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -162,10 +170,12 @@ class TableRegistryTest extends TestCase
|
|
|
*/
|
|
|
public function testRemove()
|
|
|
{
|
|
|
- $locator = $this->_setMockLocator();
|
|
|
- $locator->expects($this->once())->method('remove')->with('Test');
|
|
|
+ $this->deprecated(function () {
|
|
|
+ $locator = $this->_setMockLocator();
|
|
|
+ $locator->expects($this->once())->method('remove')->with('Test');
|
|
|
|
|
|
- TableRegistry::remove('Test');
|
|
|
+ TableRegistry::remove('Test');
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -175,9 +185,11 @@ class TableRegistryTest extends TestCase
|
|
|
*/
|
|
|
public function testClear()
|
|
|
{
|
|
|
- $locator = $this->_setMockLocator();
|
|
|
- $locator->expects($this->once())->method('clear');
|
|
|
+ $this->deprecated(function () {
|
|
|
+ $locator = $this->_setMockLocator();
|
|
|
+ $locator->expects($this->once())->method('clear');
|
|
|
|
|
|
- TableRegistry::clear();
|
|
|
+ TableRegistry::clear();
|
|
|
+ });
|
|
|
}
|
|
|
}
|