本文整理汇总了PHP中ThePaper类的典型用法代码示例。如果您正苦于以下问题:PHP ThePaper类的具体用法?PHP ThePaper怎么用?PHP ThePaper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ThePaper类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testHabtmSaveKeyResolution
/**
* testHabtmSaveKeyResolution method
*
* @return void
*/
public function testHabtmSaveKeyResolution()
{
$this->loadFixtures('Apple', 'Device', 'ThePaperMonkies');
$ThePaper = new ThePaper();
$ThePaper->id = 1;
$ThePaper->save(array('Monkey' => array(2, 3)));
$result = $ThePaper->findById(1);
$expected = array(array('id' => '2', 'device_type_id' => '1', 'name' => 'Device 2', 'typ' => '1'), array('id' => '3', 'device_type_id' => '1', 'name' => 'Device 3', 'typ' => '2'));
$this->assertEquals($expected, $result['Monkey']);
$ThePaper->id = 2;
$ThePaper->save(array('Monkey' => array(1, 2, 3)));
$result = $ThePaper->findById(2);
$expected = array(array('id' => '1', 'device_type_id' => '1', 'name' => 'Device 1', 'typ' => '1'), array('id' => '2', 'device_type_id' => '1', 'name' => 'Device 2', 'typ' => '1'), array('id' => '3', 'device_type_id' => '1', 'name' => 'Device 3', 'typ' => '2'));
$this->assertEquals($expected, $result['Monkey']);
$ThePaper->id = 2;
$ThePaper->save(array('Monkey' => array(1, 3)));
$result = $ThePaper->findById(2);
$expected = array(array('id' => '1', 'device_type_id' => '1', 'name' => 'Device 1', 'typ' => '1'), array('id' => '3', 'device_type_id' => '1', 'name' => 'Device 3', 'typ' => '2'));
$this->assertEquals($expected, $result['Monkey']);
$result = $ThePaper->findById(1);
$expected = array(array('id' => '2', 'device_type_id' => '1', 'name' => 'Device 2', 'typ' => '1'), array('id' => '3', 'device_type_id' => '1', 'name' => 'Device 3', 'typ' => '2'));
$this->assertEquals($expected, $result['Monkey']);
}
开发者ID:manzapanza,项目名称:cakephp-api-utils,代码行数:28,代码来源:ModelWriteTest.php
示例2: testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable
/**
* testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable method
*
* @return void
*/
public function testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable()
{
$this->loadFixtures('Apple', 'Device', 'ThePaperMonkies');
$ThePaper = new ThePaper();
$ThePaper->id = 1;
$ThePaper->save(array('Monkey' => array(2, 3)));
$result = $ThePaper->findById(1);
$expected = array(array('id' => '2', 'device_type_id' => '1', 'name' => 'Device 2', 'typ' => '1'), array('id' => '3', 'device_type_id' => '1', 'name' => 'Device 3', 'typ' => '2'));
$this->assertEquals($expected, $result['Monkey']);
$ThePaper = new ThePaper();
$ThePaper->id = 2;
$ThePaper->save(array('Monkey' => array(2, 3)));
$result = $ThePaper->findById(2);
$expected = array(array('id' => '2', 'device_type_id' => '1', 'name' => 'Device 2', 'typ' => '1'), array('id' => '3', 'device_type_id' => '1', 'name' => 'Device 3', 'typ' => '2'));
$this->assertEquals($expected, $result['Monkey']);
$ThePaper->delete(1);
$result = $ThePaper->findById(2);
$expected = array(array('id' => '2', 'device_type_id' => '1', 'name' => 'Device 2', 'typ' => '1'), array('id' => '3', 'device_type_id' => '1', 'name' => 'Device 3', 'typ' => '2'));
$this->assertEquals($expected, $result['Monkey']);
}
开发者ID:pritten,项目名称:SmartCitizen.me,代码行数:25,代码来源:ModelDeleteTest.php
注:本文中的ThePaper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论