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


PHP Stub::make方法代码示例

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


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

示例1: makeTestCase

 protected function makeTestCase($file, $name = '')
 {
     return Stub::make('\Codeception\Lib\DescriptiveTestCase', [
             'getReportFields' => ['file' => codecept_root_dir() . $file],
             'getName' => $name]
     );
 }
开发者ID:Vrian7ipx,项目名称:cascadadev,代码行数:7,代码来源:GroupManagerTest.php

示例2: setStubResponse

 private function setStubResponse($response)
 {
     $connectionModule = Stub::make('\\Codeception\\Module\\UniversalFramework', ['_getResponseContent' => $response]);
     $this->module->_inject($connectionModule);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
 }
开发者ID:vladislavl-hyuna,项目名称:crmapp,代码行数:7,代码来源:RestTest.php

示例3: testDispatchMethod

 public function testDispatchMethod()
 {
     $separator = Storage::$separator;
     $method = self::getPrivateMethod('dispatch');
     $structure = $method->invoke(Stub::make(self::$class), "base{$separator}inner{$separator}key");
     $this->assertEquals($structure, array('base', 'inner', 'key'), 'Parsing of the passed path is failed');
 }
开发者ID:zhikiri,项目名称:storage,代码行数:7,代码来源:StorageTest.php

示例4: testHaveAndSeeInDatabase

 public function testHaveAndSeeInDatabase()
 {
     $this->module->haveInDatabase('users', array('name' => 'john'));
     $this->module->seeInDatabase('users', array('name' => 'john'));
     $this->module->_before(\Codeception\Util\Stub::make('\\Codeception\\TestCase'));
     $this->module->dontSeeInDatabase('users', array('name' => 'john'));
 }
开发者ID:pfz,项目名称:codeception,代码行数:7,代码来源:DbTest.php

示例5: create

 /**
  * @return Client
  */
 private static function create()
 {
     /** @var Delivery $delivery */
     $delivery = Stub::make('ArchiDelivery\\Delivery');
     $client = new Client($delivery);
     return $client;
 }
开发者ID:stee1cat,项目名称:archi-delivery,代码行数:10,代码来源:ClientTest.php

示例6: run

 public function run(CodeGuy $I)
 {
     $I->wantTo('run steps from scenario');
     $I->haveStub($test = Stub::makeEmpty('\\Codeception\\TestCase\\Cept'));
     $I->haveStub($scenario = Stub::make('\\Codeception\\Scenario', array('test' => $test, 'steps' => Stub::factory('\\Codeception\\Step', 2))));
     $I->executeTestedMethodOn($scenario)->seeMethodInvoked($test, 'runStep')->seePropertyEquals($scenario, 'currentStep', 1);
 }
开发者ID:BatVane,项目名称:Codeception,代码行数:7,代码来源:ScenarioCest.php

示例7: testCreateInstanceWithRingPHP

 public function testCreateInstanceWithRingPHP()
 {
     $log = $trace = Stub::make('\\Monolog\\Logger', []);
     $ringphp_handler = Stub::make('WyriHaximus\\React\\RingPHP\\HttpClientAdapter');
     $connection = new Guzzle5Connection(['host' => 'localhost', 'port' => 9200, 'ringphp_handler' => $ringphp_handler], null, $log, $trace);
     $this->assertInstanceOf('Iwai\\Elasticsearch\\Guzzle5Connection', $connection);
 }
开发者ID:iwai,项目名称:elasticsearch-guzzle5connection,代码行数:7,代码来源:Guzzle5ConnectionTest.php

示例8: setStubResponse

 private function setStubResponse($response)
 {
     $this->phpBrowser = Stub::make('\\Codeception\\Module\\PhpBrowser', ['_getResponseContent' => $response]);
     $this->module->_inject($this->phpBrowser);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
 }
开发者ID:nsgomez,项目名称:Codeception,代码行数:7,代码来源:PhpBrowserRestTest.php

示例9: test_unserialize_real_serialized_object

 public function test_unserialize_real_serialized_object()
 {
     $user = Stub::make('StdClass', array('username' => 'username', 'email' => 'email@example.com'));
     $so = new SerializedObject(serialize($user));
     $result = $so->unserialize();
     $this->assertEquals($result->username, 'username');
     $this->assertEquals($result->email, 'email@example.com');
 }
开发者ID:tequilarapido,项目名称:php-serialized,代码行数:8,代码来源:SerializedObjectTest.php

示例10: testHaveAndSeeInDatabase

 public function testHaveAndSeeInDatabase()
 {
     $user_id = $this->module->haveInDatabase('users', array('name' => 'john', 'email' => 'john@jon.com'));
     $this->assertInternalType('integer', $user_id);
     $this->module->seeInDatabase('users', array('name' => 'john', 'email' => 'john@jon.com'));
     $this->module->_after(\Codeception\Util\Stub::make('\Codeception\TestCase'));
     $this->module->dontSeeInDatabase('users', array('name' => 'john'));
 }
开发者ID:hendryguna,项目名称:laravel-basic,代码行数:8,代码来源:DbTest.php

示例11: convertWithException

 public function convertWithException(\CodeGuy $I)
 {
     $I->wantTo("test if converting of different measure types fails.");
     $I->haveStub($converter = Stub::make($this->class));
     $I->amTestingMethod('\\Measure\\Converter.convert');
     $I->executeTestedMethodOn($converter, 1, 'liter', 'kg');
     $I->seeExceptionThrown('\\ErrorException');
 }
开发者ID:xobb,项目名称:mconv,代码行数:8,代码来源:ConverterCest.php

示例12: testGetHttpClient

 public function testGetHttpClient()
 {
     /** @var \AwesomeMotive\Drip\Token $token */
     $token = Stub::make("\\AwesomeMotive\\Drip\\Token", ['get_accessToken' => '1234']);
     $this->drip->set_token($token);
     $client = $this->drip->get_httpClient();
     $this->assertInstanceOf("\\GuzzleHttp\\Client", $client);
 }
开发者ID:awesomemotive,项目名称:drip,代码行数:8,代码来源:DripTest.php

示例13: testGetDocumentsIdsReturnsEmptyArray

 public function testGetDocumentsIdsReturnsEmptyArray()
 {
     $query = Stub::make(SearchQuery::class, ['getFilters' => function () {
         return [];
     }]);
     $this->object = new ResultSet($query, []);
     $this->assertSame([], $this->object->getDocumentIds());
 }
开发者ID:scorpioframework,项目名称:sphinx-search,代码行数:8,代码来源:ResultSetTest.php

示例14: testMake

 public function testMake()
 {
     $dummy = Stub::make('DummyClass', array('goodByeWorld' => function () {
         return 'hello world';
     }));
     $this->assertEquals($this->dummy->helloWorld(), $dummy->helloWorld());
     $this->assertEquals("hello world", $dummy->goodByeWorld());
 }
开发者ID:BatVane,项目名称:Codeception,代码行数:8,代码来源:StubTest.php

示例15: setUp

 protected function setUp()
 {
     $this->moduleContainer = new ModuleContainer(Stub::make('Codeception\\Lib\\Di'), []);
     $this->moduleContainer->create('EmulateModuleHelper');
     $this->modules = $this->moduleContainer->all();
     $this->actions = $this->moduleContainer->getActions();
     $this->makeCommand('\\Codeception\\Command\\GenerateScenarios');
     $this->config = array('paths' => array('tests' => 'tests/data/claypit/tests/', 'data' => '_data'), 'class_name' => 'DumbGuy', 'path' => 'tests/data/claypit/tests/dummy/');
 }
开发者ID:corcre,项目名称:elabftw,代码行数:9,代码来源:GenerateScenarioTest.php


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