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


PHP PHPUnit_Framework_MockObject_MockObject::bake方法代码示例

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


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

示例1: testBakePlugin

 /**
  * Test baking within a plugin.
  *
  * @return void
  */
 public function testBakePlugin()
 {
     $this->_loadTestPlugin('TestBake');
     $path = Plugin::path('TestBake');
     $this->Task->plugin = 'TestBake';
     $this->Task->expects($this->at(0))->method('createFile')->with($this->_normalizePath($path . 'src/Template/Cell/Example/display.ctp'), '');
     $this->Task->expects($this->at(1))->method('createFile')->with($this->_normalizePath($path . 'src/View/Cell/ExampleCell.php'), $this->stringContains('class ExampleCell extends Cell'));
     $result = $this->Task->bake('Example');
     $this->assertSameAsFile(__FUNCTION__ . '.php', $result);
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:15,代码来源:CellTaskTest.php

示例2: testBakePlugin

 /**
  * Test baking within a plugin.
  *
  * @return void
  */
 public function testBakePlugin()
 {
     $this->_loadTestPlugin('TestBake');
     $path = Plugin::path('TestBake');
     $this->Task->plugin = 'TestBake';
     $this->Task->expects($this->once())->method('createFile')->with($this->_normalizePath($path . 'src/Model/Behavior/ExampleBehavior.php'), $this->stringContains('class ExampleBehavior extends Behavior'));
     $result = $this->Task->bake('Example');
     $this->assertSameAsFile(__FUNCTION__ . '.php', $result);
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:14,代码来源:SimpleBakeTaskTest.php

示例3: testBakeWithPlugin

 /**
  * test bake() with a -plugin param
  *
  * @return void
  */
 public function testBakeWithPlugin()
 {
     $this->Task->plugin = 'TestTest';
     Plugin::load('TestTest', ['path' => APP . 'Plugin' . DS . 'TestTest' . DS]);
     $path = APP . 'Plugin/TestTest/tests/TestCase/View/Helper/FormHelperTest.php';
     $path = str_replace('/', DS, $path);
     $this->Task->expects($this->once())->method('createFile')->with($path, $this->anything());
     $this->Task->bake('Helper', 'Form');
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:14,代码来源:TestTaskTest.php

示例4: testBakePlugin

 /**
  * Test baking within a plugin.
  *
  * @return void
  */
 public function testBakePlugin()
 {
     $this->_loadTestPlugin('TestBake');
     $path = Plugin::path('TestBake');
     $this->Task->plugin = 'TestBake';
     $this->Task->expects($this->at(0))->method('createFile')->with($this->_normalizePath($path . 'src/Shell/Task/ExampleTask.php'), $this->logicalAnd($this->stringContains('namespace TestBake\\Shell\\Task;'), $this->stringContains('class ExampleTask extends Shell')));
     $result = $this->Task->bake('Example');
     $this->assertSameAsFile(__FUNCTION__ . '.php', $result);
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:14,代码来源:TaskTaskTest.php

示例5: testBakePlugin

 /**
  * Test baking within a plugin.
  *
  * @return void
  */
 public function testBakePlugin()
 {
     $this->_loadTestPlugin('TestBake');
     $path = Plugin::path('TestBake');
     $this->Task->plugin = 'TestBake';
     $this->Task->expects($this->at(0))->method('createFile')->with($this->_normalizePath($path . 'src/Template/Layout/Email/html/example.ctp'), '');
     $this->Task->expects($this->at(1))->method('createFile')->with($this->_normalizePath($path . 'src/Template/Layout/Email/text/example.ctp'), '');
     $this->Task->expects($this->at(2))->method('createFile')->with($this->_normalizePath($path . 'src/Mailer/ExampleMailer.php'), $this->stringContains('class ExampleMailer extends Mailer'));
     $result = $this->Task->bake('Example');
     $this->assertSameAsFile(__FUNCTION__ . '.php', $result);
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:16,代码来源:MailerTaskTest.php

示例6: testRecordGenerationForBinaryAndFloat

 /**
  * test record generation with float and binary types
  *
  * @return void
  */
 public function testRecordGenerationForBinaryAndFloat()
 {
     $this->Task->connection = 'test';
     $result = $this->Task->bake('Article', 'datatypes');
     $this->assertContains("'float_field' => 1", $result);
     $this->assertContains("'decimal_field' => 1.5", $result);
     $this->assertContains("'huge_int' => 1", $result);
     $this->assertContains("'bool' => 1", $result);
     $this->assertContains("_constraints", $result);
     $this->assertContains("'primary' => ['type' => 'primary'", $result);
     $this->assertContains("'columns' => ['id']", $result);
     $this->assertContains("'uuid' => ['type' => 'uuid'", $result);
     $this->assertRegExp("/(\\s+)('uuid' => ')([a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12})(')/", $result);
     $result = $this->Task->bake('Article', 'binary_tests');
     $this->assertContains("'data' => 'Lorem ipsum dolor sit amet'", $result);
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:21,代码来源:FixtureTaskTest.php

示例7: testBakeVendorName

 /**
  * test bake with vendor plugin
  *
  * @return void
  */
 public function testBakeVendorName()
 {
     $this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
     $this->Task->bake('Company/Example');
     $this->assertPluginContents('Company/Example');
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:11,代码来源:PluginTaskTest.php

示例8: testBakeActionsContent

 /**
  *
  * test that bakeActions is creating the correct controller Code. (Using sessions)
  *
  * @return void
  */
 public function testBakeActionsContent()
 {
     $result = $this->Task->bake('BakeArticles');
     $this->assertSameAsFile(__FUNCTION__ . '.php', $result);
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:11,代码来源:ControllerTaskTest.php


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