本文整理汇总了PHP中OverallFavorite::create方法的典型用法代码示例。如果您正苦于以下问题:PHP OverallFavorite::create方法的具体用法?PHP OverallFavorite::create怎么用?PHP OverallFavorite::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OverallFavorite
的用法示例。
在下文中一共展示了OverallFavorite::create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCacheClearOnSave
/**
* test that Caches are getting cleared on save().
* ensure that both inflections of controller names are getting cleared
* as url for controller could be either overallFavorites/index or overall_favorites/index
*
* @return void
*/
public function testCacheClearOnSave()
{
$_back = array('check' => Configure::read('Cache.check'), 'disable' => Configure::read('Cache.disable'));
Configure::write('Cache.check', true);
Configure::write('Cache.disable', false);
$this->loadFixtures('OverallFavorite');
$OverallFavorite = new OverallFavorite();
touch(CACHE . 'views' . DS . 'some_dir_overallfavorites_index.php');
touch(CACHE . 'views' . DS . 'some_dir_overall_favorites_index.php');
$data = array('OverallFavorite' => array('id' => 22, 'model_type' => '8-track', 'model_id' => '3', 'priority' => '1'));
$OverallFavorite->create($data);
$OverallFavorite->save();
$this->assertFalse(file_exists(CACHE . 'views' . DS . 'some_dir_overallfavorites_index.php'));
$this->assertFalse(file_exists(CACHE . 'views' . DS . 'some_dir_overall_favorites_index.php'));
Configure::write('Cache.check', $_back['check']);
Configure::write('Cache.disable', $_back['disable']);
}