當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PyStringNode::getRaw方法代碼示例

本文整理匯總了PHP中Behat\Gherkin\Node\PyStringNode::getRaw方法的典型用法代碼示例。如果您正苦於以下問題:PHP PyStringNode::getRaw方法的具體用法?PHP PyStringNode::getRaw怎麽用?PHP PyStringNode::getRaw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Behat\Gherkin\Node\PyStringNode的用法示例。


在下文中一共展示了PyStringNode::getRaw方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: theResponseShouldBe

 /**
  * @Then /^(?:the )?response should be:$/
  */
 public function theResponseShouldBe(PyStringNode $content)
 {
     if ($this->getResponseHeader('Content-Type') === 'application/json') {
         $this->assertJsonStringEqualsJsonString($this->adaptContent($content->getRaw()), $this->getResponse()->getContent(), sprintf('The content of the response is not the expected'));
     } else {
         Assertions::assertEquals($content->getRaw(), $this->getResponse()->getContent(), sprintf('The content of the response is not the expected'));
     }
 }
開發者ID:JavierCane,項目名稱:mpwar,代碼行數:11,代碼來源:FeatureContext.php

示例2: theResponseShouldEqualToJson

 /**
  * @Then /^(?:the )?response should equal to json:$/
  */
 public function theResponseShouldEqualToJson(PyStringNode $jsonString)
 {
     $expected = json_decode($jsonString->getRaw(), true);
     $actual = $this->lastResponse;
     if (null === $expected) {
         throw new \RuntimeException("Can not convert etalon to json:\n" . $jsonString->getRaw());
     }
     assertEquals($expected, $actual, "Failed asserting that equals to \n" . print_r($actual, true));
 }
開發者ID:nickl-,項目名稱:php-github-api,代碼行數:12,代碼來源:FeatureContext.php

示例3: iSendARequestToUrlWithBody

 /**
  * @When I send a :method request to URL :url with body:
  */
 public function iSendARequestToUrlWithBody($method, $url, PyStringNode $body)
 {
     $bodyReplace = $body->getRaw();
     $bodyReplace = $this->replaceParameters($bodyReplace);
     $body = new PyStringNode([$bodyReplace], $body->getLine());
     $this->restContext->iSendARequestToWithBody($method, $this->replaceParameters($url), $body);
 }
開發者ID:hogosha,項目名稱:hogosha,代碼行數:10,代碼來源:ApiContext.php

示例4: theSystemShouldHaveTheFollowingOperations

 /**
  * @Then the system should have the following info sms subscription low balance reminder logs:
  *
  * @param PyStringNode $body
  */
 public function theSystemShouldHaveTheFollowingOperations(PyStringNode $body)
 {
     /** @var CollectLogsTestWorker $collectLogsTestWorker */
     $collectLogsTestWorker = $this->kernel->getContainer()->get('muchacuba.info_sms.subscription.low_balance_reminder.collect_logs_test_worker');
     Assert::assertTrue((new SimpleFactory())->createMatcher()->match(iterator_to_array($collectLogsTestWorker->collect()), (array) json_decode($body->getRaw(), true)));
     $this->rootContext->ignoreState('Muchacuba\\InfoSms\\Subscription\\LowBalanceReminder\\Log');
 }
開發者ID:nabelhm,項目名稱:api,代碼行數:12,代碼來源:Context.php

示例5:

 function it_saves_behat_feature_file(PyStringNode $config, Filesystem $filesystem)
 {
     $config->getRaw()->willReturn('Feature: test');
     $filesystem->dumpFile(Argument::containingString('/features/feature.feature'), 'Feature: test')->shouldBeCalled();
     $this->createWorkingDirectory();
     $this->iHaveTheFeature($config);
 }
開發者ID:elvetemedve,項目名稱:behat-test-runner,代碼行數:7,代碼來源:TestRunnerContextSpec.php

示例6: theSystemShouldHaveTheFollowingUniquenesses

 /**
  * @Given the system should have the following uniquenesses:
  */
 public function theSystemShouldHaveTheFollowingUniquenesses(PyStringNode $body)
 {
     /** @var CollectUniquenessTestWorker $collectUniquenessTestWorker */
     $collectUniquenessTestWorker = $this->kernel->getContainer()->get('cubalider.unique.collect_uniqueness_test_worker');
     Assert::assertTrue((new SimpleFactory())->createMatcher()->match(iterator_to_array($collectUniquenessTestWorker->collect()), (array) json_decode($body->getRaw(), true)));
     $this->rootContext->ignoreState('Cubalider\\Uniqueness');
 }
開發者ID:nabelhm,項目名稱:api,代碼行數:10,代碼來源:UniquenessContext.php

示例7: thereExistsASnippetTemplateWithTheFollowingPropertyConfiguration

    /**
     * @Given there exists a snippet template ":name" with the following property configuration
     */
    public function thereExistsASnippetTemplateWithTheFollowingPropertyConfiguration($name, PyStringNode $string)
    {
        $template = <<<EOT
<?xml version="1.0" ?>

<template xmlns="http://schemas.sulu.io/template/template"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd"
          >

    <key>%s</key>

    <properties>
        <property name="title" type="text_line" mandatory="true">
            <meta>
                <title lang="de">Title</title>
                <title lang="en">Title</title>
            </meta>
        </property>

%s

    </properties>
</template>
EOT;
        $template = sprintf($template, $name, $string->getRaw());
        $this->createStructureTemplate('snippet', $name, $template);
    }
開發者ID:ollietb,項目名稱:sulu,代碼行數:31,代碼來源:SnippetContext.php

示例8: theSystemShouldHaveTheFollowingInternetProfiles

 /**
  * @Given the system should have the following internet profiles:
  *
  * @param PyStringNode $body
  *
  */
 public function theSystemShouldHaveTheFollowingInternetProfiles(PyStringNode $body)
 {
     /** @var CollectProfilesTestWorker $collectProfilesTestWorker */
     $collectProfilesTestWorker = $this->kernel->getContainer()->get('muchacuba.internet.collect_profiles_test_worker');
     Assert::assertTrue((new SimpleFactory())->createMatcher()->match(iterator_to_array($collectProfilesTestWorker->collect()), (array) json_decode($body->getRaw(), true)));
     $this->rootContext->ignoreState('Muchacuba\\Internet\\Profile');
 }
開發者ID:nabelhm,項目名稱:api,代碼行數:13,代碼來源:Context.php

示例9: iShouldGetTheFollowingData

 /**
  * @Then I should get the following data:
  *
  * @param PyStringNode $string
  *
  * @throws \Exception
  */
 public function iShouldGetTheFollowingData(PyStringNode $string)
 {
     $matcher = (new SimpleFactory())->createMatcher();
     if (!$matcher->match(json_decode(json_encode($this->result), true), json_decode((string) $string->getRaw(), true))) {
         throw new \Exception($matcher->getError());
     }
 }
開發者ID:cubalider,項目名稱:internet-profile,代碼行數:14,代碼來源:Context.php

示例10: theSystemShouldHaveTheFollowingDebtOperations

 /**
  * @Given the system should have the following recharge card profiles debt operations
  */
 public function theSystemShouldHaveTheFollowingDebtOperations(PyStringNode $body)
 {
     /** @var CollectOperationsTestWorker $collectOperationsTestWorker */
     $collectOperationsTestWorker = $this->kernel->getContainer()->get('muchacuba.recharge_card.profile.debt.collect_operations_test_worker');
     Assert::assertTrue((new SimpleFactory())->createMatcher()->match(iterator_to_array($collectOperationsTestWorker->collect()), (array) json_decode($body->getRaw(), true)));
     $this->rootContext->ignoreState('Muchacuba\\RechargeCard\\Profile\\Debt\\Operation');
 }
開發者ID:nabelhm,項目名稱:api,代碼行數:10,代碼來源:Context.php

示例11: iSendARequestToWithBody

 /**
  * Sends a HTTP request with a body
  *
  * @Given I send a :method request to :url with body:
  */
 public function iSendARequestToWithBody($method, $url, PyStringNode $body)
 {
     $client = $this->getSession()->getDriver()->getClient();
     // intercept redirection
     $client->followRedirects(false);
     $client->request($method, $this->locatePath($url), array(), array(), array(), $body->getRaw());
     $client->followRedirects(true);
 }
開發者ID:ducbin,項目名稱:behatch-contexts,代碼行數:13,代碼來源:RestContext.php

示例12: itShouldContain

 /**
  * @Then /^it should contain:$/
  */
 public function itShouldContain(PyStringNode $string)
 {
     $sql = file_get_contents($this->workingDirectory . '/behat_table.sql');
     if (empty($sql) || !preg_match(sprintf('/%s/', preg_quote($string->getRaw())), $sql)) {
         $this->printDebug($sql);
         throw new Exception('Content not found');
     }
 }
開發者ID:kalaspuffar,項目名稱:php-orm-benchmark,代碼行數:11,代碼來源:FeatureContext.php

示例13: theSystemHasTheFollowingUserAccounts

 /**
  * @When the system has the following user accounts:
  *
  * @param PyStringNode $body
  */
 public function theSystemHasTheFollowingUserAccounts(PyStringNode $body)
 {
     /** @var CreateAccountTestWorker $createAccountTestWorker */
     $createAccountTestWorker = $this->kernel->getContainer()->get('muchacuba.user.create_account_test_worker');
     $items = json_decode($body->getRaw(), true);
     foreach ($items as $item) {
         $createAccountTestWorker->create($item['id'], $item['username'], $item['password'], $item['roles']);
     }
 }
開發者ID:nabelhm,項目名稱:api,代碼行數:14,代碼來源:Context.php

示例14: iWriteASpecWithFollowingCode

 /**
  * @When /^I write a (?:spec|class) "([^"]*)" with following code$/
  */
 public function iWriteASpecWithFollowingCode($file, PyStringNode $codeContent)
 {
     $dirname = dirname($file);
     if (!file_exists($dirname)) {
         mkdir($dirname, 0777, true);
     }
     file_put_contents($file, $codeContent->getRaw());
     require_once $file;
 }
開發者ID:horussoft,項目名稱:phpspec-data-provider-extension,代碼行數:12,代碼來源:PHPSpecContext.php

示例15: iShouldGet

 /** @Then /^I should get:$/ */
 public function iShouldGet(PyStringNode $string)
 {
     //        if ((string) $string !== $this->output) {
     //            throw new Exception(
     //                "Actual output is:\n" . $this->output
     //            );
     //        }
     assertEquals($string->getRaw(), $this->output);
 }
開發者ID:ricfrank,項目名稱:Bdd-with-Behat,代碼行數:10,代碼來源:FeatureContext.php


注:本文中的Behat\Gherkin\Node\PyStringNode::getRaw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。