assertNotContains() public static method

Asserts that a haystack does not contain a needle.
public static assertNotContains ( mixed $needle, mixed $haystack, string $message = '', boolean $ignoreCase = false, boolean $checkForObjectIdentity = true, boolean $checkForNonObjectIdentity = false )
$needle mixed
$haystack mixed
$message string
$ignoreCase boolean
$checkForObjectIdentity boolean
$checkForNonObjectIdentity boolean
コード例 #1
0
 /**
  * Assert that deleted customers address is not displayed on backend during order creation.
  *
  * @param SalesOrderIndex $orderIndex
  * @param SalesOrderCreateIndex $orderCreateIndex
  * @param Address $deletedAddress
  * @param Customer $customer
  * @return void
  */
 public function processAssert(SalesOrderIndex $orderIndex, SalesOrderCreateIndex $orderCreateIndex, Address $deletedAddress, Customer $customer)
 {
     $orderIndex->open()->getPageActionsBlock()->addNew();
     $orderCreateIndex->getCustomerGrid()->selectCustomer($customer);
     $orderCreateIndex->getStoreBlock()->selectStoreView();
     \PHPUnit_Framework_Assert::assertNotContains($this->prepareAddress($deletedAddress), $orderCreateIndex->getCreateBlock()->getBillingAddressForm()->getExistingAddresses(), 'Deleted address is present on backend during order creation');
 }
コード例 #2
0
 /**
  * @Then the field :name should not have an error containing :message
  */
 public function theFieldShouldNotHaveAnErrorContaining($name, $message)
 {
     $field = $this->assertSession()->fieldExists($name);
     $parent = $field->getParent();
     if (false === stripos($parent->getAttribute('class'), $this->fieldContainerClass)) {
         $parent = $parent->getParent();
     }
     Assert::assertNotContains($message, $parent->getText());
 }
コード例 #3
0
 /**
  * Assert that created CMS block non visible on frontend category page.
  *
  * @param CmsIndex $cmsIndex
  * @param CmsBlock $cmsBlock
  * @param CatalogCategoryView $catalogCategoryView
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CmsBlock $cmsBlock, CatalogCategoryView $catalogCategoryView, FixtureFactory $fixtureFactory)
 {
     $category = $fixtureFactory->createByCode('catalogCategory', ['dataSet' => 'default_subcategory', 'data' => ['display_mode' => 'Static block and products', 'landing_page' => $cmsBlock->getTitle()]]);
     $category->persist();
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($category->getName());
     $categoryViewContent = $catalogCategoryView->getViewBlock()->getText();
     $cmsBlockContent = explode("\n", $categoryViewContent);
     \PHPUnit_Framework_Assert::assertNotContains($cmsBlock->getContent(), $cmsBlockContent);
 }
コード例 #4
0
 /**
  * @Given /^response should (?P<not>|not )contain "([^"]*)"$/
  */
 public function responseShouldContain($not = '', $expectedValue)
 {
     $shouldNotExist = !empty($not);
     $value = $this->decodeJson($this->lastResponse->getContent());
     $value = is_array($value) ? array_keys($value) : $value;
     if ($shouldNotExist) {
         \PHPUnit_Framework_Assert::assertNotContains($expectedValue, $value);
     } else {
         \PHPUnit_Framework_Assert::assertContains($expectedValue, $value);
     }
 }
コード例 #5
0
 protected function setStatusTestingApp($enabled)
 {
     $this->sendingTo($enabled ? 'post' : 'delete', '/cloud/apps/testing');
     $this->theHTTPStatusCodeShouldBe('200');
     $this->theOCSStatusCodeShouldBe('100');
     $this->sendingTo('get', '/cloud/apps?filter=enabled');
     $this->theHTTPStatusCodeShouldBe('200');
     if ($enabled) {
         PHPUnit_Framework_Assert::assertContains('testing', $this->response->getBody()->getContents());
     } else {
         PHPUnit_Framework_Assert::assertNotContains('testing', $this->response->getBody()->getContents());
     }
 }
コード例 #6
0
ファイル: Functions.php プロジェクト: nbalonso/MunkiFace
/**
 * Asserts that a haystack does not contain a needle.
 *
 * @param  mixed   $needle
 * @param  mixed   $haystack
 * @param  string  $message
 * @param  boolean $ignoreCase
 * @param  boolean $checkForObjectIdentity
 * @since  Method available since Release 2.1.0
 */
function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE)
{
    return PHPUnit_Framework_Assert::assertNotContains($needle, $haystack, $message, $ignoreCase, $checkForObjectIdentity);
}
コード例 #7
0
ファイル: StringMatcher.php プロジェクト: dekeysoft/pu-tester
 public function doesNotContain($needle)
 {
     Assert::assertNotContains($needle, $this->actual, $this->description);
     return $this;
 }
コード例 #8
0
 /**
  * @Given /^user "([^"]*)" is not a subadmin of group "([^"]*)"$/
  * @param string $user
  * @param string $group
  */
 public function userIsNotSubadminOfGroup($user, $group)
 {
     $fullUrl = $this->baseUrl . "v2.php/cloud/groups/{$group}/subadmins";
     $client = new Client();
     $options = [];
     if ($this->currentUser === 'admin') {
         $options['auth'] = $this->adminUser;
     }
     $this->response = $client->get($fullUrl, $options);
     $respondedArray = $this->getArrayOfSubadminsResponded($this->response);
     sort($respondedArray);
     PHPUnit_Framework_Assert::assertNotContains($user, $respondedArray);
     PHPUnit_Framework_Assert::assertEquals(200, $this->response->getStatusCode());
 }
コード例 #9
0
ファイル: Filesystem.php プロジェクト: pfz/codeception
 /**
  * Checks If opened file doesn't contain `text` in it
  *
  * ``` php
  * <?php
  * $I->openFile('composer.json');
  * $I->seeInThisFile('codeception/codeception');
  * ?>
  * ```
  *
  * @param $text
  */
 public function dontSeeInThisFile($text)
 {
     \PHPUnit_Framework_Assert::assertNotContains($text, $this->file, "text {$text} in currently opened file");
 }
コード例 #10
0
ファイル: FTP.php プロジェクト: samuelmoncarey/codeception
 /**
  * Checks if file does not exists in path on the remote FTP/SFTP system
  *
  * @param $filename
  * @param string $path
  */
 public function dontSeeFileFound($filename, $path = '')
 {
     $files = $this->grabFileList($path);
     $this->debug("don't see file: {$filename}");
     \PHPUnit_Framework_Assert::assertNotContains($filename, $files);
 }
コード例 #11
0
ファイル: Unit.php プロジェクト: NaszvadiG/ImageCMS
 /**
  * Checks that the result of the last execution doesn't contain a value.
  *
  * @param $value
  * @deprecated
  */
 public function dontSeeResultContains($value)
 {
     \PHPUnit_Framework_Assert::assertNotContains($value, $this->last_result);
 }
コード例 #12
0
ファイル: WebDriverTestCase.php プロジェクト: kingsj/core
 public function assert_string_not_present($expected_missing_string, $message)
 {
     $page_text = $this->get_text();
     PHPUnit_Framework_Assert::assertNotContains($expected_missing_string, $page_text, $message);
 }
コード例 #13
0
ファイル: Expect.php プロジェクト: jasonmccreary/expect
 public function toContain($needle)
 {
     if ($this->negate) {
         a::assertNotContains($needle, $this->actual);
     } else {
         a::assertContains($needle, $this->actual);
     }
 }
コード例 #14
0
 /**
  * @Then /^I should not see "([^"]*)" in the command output$/
  */
 public function iShouldNotSeeInTheCommandOutput($pattern)
 {
     PHPUnit_Framework_Assert::assertNotContains($pattern, $this->process->getOutput());
 }
コード例 #15
0
ファイル: ContextBase.php プロジェクト: hason/phpcr-shell
 /**
  * @Then /^I should not see the following:$/
  */
 public function iShouldNotSeeTheFollowing(PyStringNode $string)
 {
     $output = $this->getOutput();
     \PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output);
 }
コード例 #16
0
ファイル: Driver.php プロジェクト: robinhood-zz/WebDriver-PHP
 public function assert_string_not_present($expected_missing_string)
 {
     $page_text = $this->get_text();
     PHPUnit_Framework_Assert::assertNotContains($expected_missing_string, $page_text, "Failed asserting that page text does not contain <{$expected_missing_string}>.\n{$page_text}");
 }
コード例 #17
0
 /**
  * @param $text
  * @return $this
  */
 public function notSee($text)
 {
     $crawler = $this->getClient()->getCrawler();
     Assert::assertNotContains($text, $crawler->filter('body')->text());
     return $this;
 }
コード例 #18
0
 /**
  * @Then I should not see output :text
  *
  * @param $text
  */
 public function iShouldNotSeeOutput($text)
 {
     \PHPUnit_Framework_Assert::assertNotContains($text, $this->tester->getDisplay());
 }
コード例 #19
0
 /**
  * Assert that backend page has correct title and 404 Error is absent on the page.
  *
  * @param Dashboard $dashboard
  * @param string $pageTitle
  * @return void
  */
 public function processAssert(Dashboard $dashboard, $pageTitle)
 {
     \PHPUnit_Framework_Assert::assertEquals($pageTitle, $dashboard->getTitleBlock()->getTitle(), 'Invalid page title is displayed.');
     \PHPUnit_Framework_Assert::assertNotContains(self::ERROR_TEXT, $dashboard->getErrorBlock()->getContent(), "404 Error is displayed on '{$pageTitle}' page.");
 }
コード例 #20
0
 public function assert_text_does_not_contain($expected_missing_needle)
 {
     $actual_haystack = $this->get_text();
     PHPUnit_Framework_Assert::assertNotContains($expected_missing_needle, $actual_haystack, "Failed asserting that <{$this->locator}>'s text does not contain <{$expected_missing_needle}>.");
 }
コード例 #21
0
ファイル: Framework.php プロジェクト: lenninsanchez/donadores
 public function dontSeeInCurrentUrl($uri)
 {
     \PHPUnit_Framework_Assert::assertNotContains($uri, $this->_getCurrentUri());
 }
コード例 #22
0
ファイル: Expect.php プロジェクト: jpkleemans/phpunit-expect
 /**
  * Expect that a haystack does not contain a needle.
  *
  * @param mixed $needle
  * @param string $message
  * @param bool $ignoreCase
  * @param bool $checkForObjectIdentity
  * @param bool $checkForNonObjectIdentity
  *
  * @return Expect
  */
 public function notToContain($needle, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
 {
     Assert::assertNotContains($needle, $this->value, $message, $ignoreCase, $checkForObjectIdentity, $checkForNonObjectIdentity);
     return $this;
 }
コード例 #23
0
ファイル: Cli.php プロジェクト: lenninsanchez/donadores
 /**
  * Checks that output from latest command doesn't contain text
  *
  * @param $text
  *
  */
 public function dontSeeInShellOutput($text)
 {
     $this->debug($this->output);
     \PHPUnit_Framework_Assert::assertNotContains($text, $this->output);
 }
コード例 #24
0
ファイル: Driver.php プロジェクト: sgml/WebDriver-PHP
 public function assert_string_not_present($expected_missing_string)
 {
     $end_time = time() + WebDriver::$ImplicitWaitMS / 1000;
     do {
         $page_text = $this->get_text();
     } while (time() < $end_time && strstr($page_text, $expected_missing_string) !== false);
     PHPUnit_Framework_Assert::assertNotContains($expected_missing_string, $page_text, "Failed asserting that page text does not contain <{$expected_missing_string}>.\n{$page_text}");
 }
コード例 #25
0
ファイル: REST.php プロジェクト: pfz/codeception
 /**
  * Checks weather last response do not contain text.
  *
  * @param $text
  */
 public function dontSeeResponseContains($text)
 {
     \PHPUnit_Framework_Assert::assertNotContains($text, $this->response, "REST response contains");
 }
コード例 #26
0
ファイル: SOAP.php プロジェクト: NaszvadiG/ImageCMS
 /**
  * Checks XML response does not include provided XML.
  * Comparison is done by canonicalizing both xml`s.
  * Parameter can be passed either as XmlBuilder, DOMDocument, DOMNode, XML string, or array (if no attributes).
  *
  * @param $xml
  */
 public function dontSeeSoapResponseIncludes($xml)
 {
     $xml = $this->canonicalize($xml);
     \PHPUnit_Framework_Assert::assertNotContains($xml, $this->xmlResponse->C14N(), "found in XML Response");
 }
コード例 #27
0
ファイル: Asserts.php プロジェクト: hitechdk/Codeception
 /**
  * Checks that haystack doesn't contain needle.
  *
  * @param        $needle
  * @param        $haystack
  * @param string $message
  */
 protected function assertNotContains($needle, $haystack, $message = '')
 {
     \PHPUnit_Framework_Assert::assertNotContains($needle, $haystack, $message);
 }
コード例 #28
0
ファイル: Queue.php プロジェクト: Eli-TW/Codeception
 /**
  * Check if a queue/tube does NOT exist on the queueing server.
  *
  * ```php
  * <?php
  *     $I->dontSeeQueueExists('default');
  * ?>
  * ```
  *
  * @param string $queue Queue Name
  */
 public function dontSeeQueueExists($queue)
 {
     $this->debug("don't see queue: [{$queue}]");
     \PHPUnit_Framework_Assert::assertNotContains($queue, $this->_getQueues());
 }
コード例 #29
0
ファイル: Functions.php プロジェクト: delkyd/sugarcrm_dev
/**
 * Asserts that a haystack does not contain a needle.
 *
 * @param  mixed   $needle
 * @param  mixed   $haystack
 * @param  string  $message
 * @param  boolean $ignoreCase
 * @since  Method available since Release 2.1.0
 */
function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE)
{
    return PHPUnit_Framework_Assert::assertNotContains($needle, $haystack, $message, $ignoreCase);
}
コード例 #30
0
ファイル: Verify.php プロジェクト: jaschweder/Verify
 public function notContains($needle)
 {
     a::assertNotContains($needle, $this->actual, $this->description);
 }