当前位置: 首页>>代码示例>>PHP>>正文


PHP OverallFavorite类代码示例

本文整理汇总了PHP中OverallFavorite的典型用法代码示例。如果您正苦于以下问题:PHP OverallFavorite类的具体用法?PHP OverallFavorite怎么用?PHP OverallFavorite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OverallFavorite类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testDeleteDependentWithConditions

 /**
  * testDeleteDependentWithConditions method
  *
  * @return void
  */
 public function testDeleteDependentWithConditions()
 {
     $this->loadFixtures('Cd', 'Book', 'OverallFavorite');
     $Cd = new Cd();
     $Book = new Book();
     $OverallFavorite = new OverallFavorite();
     $Cd->delete(1);
     $result = $OverallFavorite->find('all', array('fields' => array('model_type', 'model_id', 'priority')));
     $expected = array(array('OverallFavorite' => array('model_type' => 'Book', 'model_id' => 1, 'priority' => 2)));
     $this->assertTrue(is_array($result));
     $this->assertEquals($expected, $result);
     $Book->delete(1);
     $result = $OverallFavorite->find('all', array('fields' => array('model_type', 'model_id', 'priority')));
     $expected = array();
     $this->assertTrue(is_array($result));
     $this->assertEquals($expected, $result);
 }
开发者ID:pritten,项目名称:SmartCitizen.me,代码行数:22,代码来源:ModelDeleteTest.php

示例2: 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']);
 }
开发者ID:manzapanza,项目名称:cakephp-api-utils,代码行数:24,代码来源:ModelWriteTest.php


注:本文中的OverallFavorite类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。