本文整理汇总了PHP中Cake\ORM\Table::removeBehavior方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::removeBehavior方法的具体用法?PHP Table::removeBehavior怎么用?PHP Table::removeBehavior使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\ORM\Table
的用法示例。
在下文中一共展示了Table::removeBehavior方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* tear down
* @return void
*/
public function tearDown()
{
parent::tearDown();
$this->Noticias->removeBehavior("CakePtbr.AjusteData");
unset($this->Noticias, $this->Noticias);
TableRegistry::clear();
}
示例2: testRemoveBehavior
/**
* Test removing a behavior from a table.
*
* @return void
*/
public function testRemoveBehavior()
{
$mock = $this->getMock('Cake\\ORM\\BehaviorRegistry', [], [], '', false);
$mock->expects($this->once())->method('unload')->with('Sluggable');
$table = new Table(['table' => 'articles', 'behaviors' => $mock]);
$table->removeBehavior('Sluggable');
}
示例3: testRemoveBehavior
/**
* Test removing a behavior from a table.
*
* @return void
*/
public function testRemoveBehavior()
{
$mock = $this->getMockBuilder('Cake\\ORM\\BehaviorRegistry')->disableOriginalConstructor()->getMock();
$mock->expects($this->once())->method('unload')->with('Sluggable');
$table = new Table(['table' => 'articles', 'behaviors' => $mock]);
$table->removeBehavior('Sluggable');
}