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


PHP ClassRegistry::mapKeys方法代码示例

本文整理汇总了PHP中ClassRegistry::mapKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassRegistry::mapKeys方法的具体用法?PHP ClassRegistry::mapKeys怎么用?PHP ClassRegistry::mapKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ClassRegistry的用法示例。


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

示例1: testExecuteIntoInteractive

 /**
  * test the interactive side of bake.
  *
  * @return void
  */
 public function testExecuteIntoInteractive()
 {
     $tables = $this->Task->listAll('test');
     $article = array_search('bake_articles', $tables) + 1;
     $this->Task->connection = 'test';
     $this->Task->path = '/my/path/';
     $this->Task->interactive = true;
     $this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls($article, 'n', 'y', 'y', 'y', 'y', 'n', 'y'));
     $this->Task->expects($this->once())->method('_checkUnitTest')->will($this->returnValue(true));
     $this->Task->Test->expects($this->once())->method('bake');
     $this->Task->Fixture->expects($this->once())->method('bake');
     $filename = '/my/path/BakeArticle.php';
     $this->Task->expects($this->once())->method('createFile')->with($filename, $this->stringContains('class BakeArticle'));
     $this->Task->execute();
     $this->assertEquals(count(ClassRegistry::keys()), 0);
     $this->assertEquals(count(ClassRegistry::mapKeys()), 0);
 }
开发者ID:TerrasAppSolutions,项目名称:seeg-mapbiomas-workspace,代码行数:22,代码来源:ModelTaskTest.php

示例2: testExecuteIntoInteractive

 /**
  * test the interactive side of bake.
  *
  * @return void
  */
 public function testExecuteIntoInteractive()
 {
     $count = count($this->Task->listAll('test'));
     if ($count != count($this->fixtures)) {
         $this->markTestSkipped('Additional tables detected.');
     }
     $this->Task->connection = 'test';
     $this->Task->path = '/my/path/';
     $this->Task->interactive = true;
     $this->Task->expects($this->any())->method('in')->will($this->onConsecutiveCalls('1', 'n', 'y', 'y', 'y', 'y', 'n', 'y'));
     $this->Task->expects($this->once())->method('_checkUnitTest')->will($this->returnValue(true));
     $this->Task->Test->expects($this->once())->method('bake');
     $this->Task->Fixture->expects($this->once())->method('bake');
     $filename = '/my/path/BakeArticle.php';
     $this->Task->expects($this->once())->method('createFile')->with($filename, $this->stringContains('class BakeArticle'));
     $this->Task->execute();
     $this->assertEqual(count(ClassRegistry::keys()), 0);
     $this->assertEqual(count(ClassRegistry::mapKeys()), 0);
 }
开发者ID:kevguy,项目名称:Auth-Website,代码行数:24,代码来源:ModelTaskTest.php

示例3: testExecuteIntoInteractive

 /**
  * test the interactive side of bake.
  *
  * @return void
  * @access public
  */
 function testExecuteIntoInteractive()
 {
     $this->Task->connection = 'test_suite';
     $this->Task->path = '/my/path/';
     $this->Task->interactive = true;
     $this->Task->setReturnValueAt(0, 'in', '1');
     //choose article
     $this->Task->setReturnValueAt(1, 'in', 'n');
     //no validation
     $this->Task->setReturnValueAt(2, 'in', 'y');
     //yes to associations
     $this->Task->setReturnValueAt(3, 'in', 'y');
     //yes to comment relation
     $this->Task->setReturnValueAt(4, 'in', 'y');
     //yes to user relation
     $this->Task->setReturnValueAt(5, 'in', 'y');
     //yes to tag relation
     $this->Task->setReturnValueAt(6, 'in', 'n');
     //no to additional assocs
     $this->Task->setReturnValueAt(7, 'in', 'y');
     //yes to looksGood?
     $this->Task->setReturnValue('_checkUnitTest', true);
     $this->Task->Test->expectOnce('bake');
     $this->Task->Fixture->expectOnce('bake');
     $filename = '/my/path/article.php';
     $this->Task->expectOnce('createFile');
     $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/')));
     $this->Task->execute();
     $this->assertEqual(count(ClassRegistry::keys()), 0);
     $this->assertEqual(count(ClassRegistry::mapKeys()), 0);
 }
开发者ID:kevinmel2000,项目名称:Study-Buddy---CakePHP-Quiz-System,代码行数:37,代码来源:model.test.php

示例4: testBakeModel

 /**
  * test that execute passes runs bake depending with named model.
  *
  * @return void
  * @access public
  */
 function testBakeModel()
 {
     $this->Task->connection = 'test_suite';
     $this->Task->path = '/my/path/';
     $filename = '/my/path/article.php';
     $this->Task->setReturnValue('_checkUnitTest', 1);
     $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/')));
     $model =& new Model(array('name' => 'Article', 'table' => 'articles', 'ds' => 'test_suite'));
     $this->Task->bake($model);
     $this->assertEqual(count(ClassRegistry::keys()), 0);
     $this->assertEqual(count(ClassRegistry::mapKeys()), 0);
 }
开发者ID:acerato,项目名称:cntcetp,代码行数:18,代码来源:model.test.php


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