當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。