当前位置: 首页>>代码示例>>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;未经允许,请勿转载。