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
 /**
  * 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');
 }
 /**
  * @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());
 }
 /**
  * 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);
 }
 /**
  * @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);
     }
 }
 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());
     }
 }
Example #6
0
/**
 * 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);
}
Example #7
0
 public function doesNotContain($needle)
 {
     Assert::assertNotContains($needle, $this->actual, $this->description);
     return $this;
 }
Example #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());
 }
Example #9
0
 /**
  * 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");
 }
Example #10
0
 /**
  * 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);
 }
Example #11
0
 /**
  * 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);
 }
Example #12
0
 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);
 }
Example #13
0
 public function toContain($needle)
 {
     if ($this->negate) {
         a::assertNotContains($needle, $this->actual);
     } else {
         a::assertContains($needle, $this->actual);
     }
 }
Example #14
0
 /**
  * @Then /^I should not see "([^"]*)" in the command output$/
  */
 public function iShouldNotSeeInTheCommandOutput($pattern)
 {
     PHPUnit_Framework_Assert::assertNotContains($pattern, $this->process->getOutput());
 }
Example #15
0
 /**
  * @Then /^I should not see the following:$/
  */
 public function iShouldNotSeeTheFollowing(PyStringNode $string)
 {
     $output = $this->getOutput();
     \PHPUnit_Framework_Assert::assertNotContains($string->getRaw(), $output);
 }
Example #16
0
 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}");
 }
 /**
  * @param $text
  * @return $this
  */
 public function notSee($text)
 {
     $crawler = $this->getClient()->getCrawler();
     Assert::assertNotContains($text, $crawler->filter('body')->text());
     return $this;
 }
 /**
  * @Then I should not see output :text
  *
  * @param $text
  */
 public function iShouldNotSeeOutput($text)
 {
     \PHPUnit_Framework_Assert::assertNotContains($text, $this->tester->getDisplay());
 }
 /**
  * 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.");
 }
Example #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}>.");
 }
Example #21
0
 public function dontSeeInCurrentUrl($uri)
 {
     \PHPUnit_Framework_Assert::assertNotContains($uri, $this->_getCurrentUri());
 }
Example #22
0
 /**
  * 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;
 }
Example #23
0
 /**
  * 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);
 }
Example #24
0
 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}");
 }
Example #25
0
 /**
  * Checks weather last response do not contain text.
  *
  * @param $text
  */
 public function dontSeeResponseContains($text)
 {
     \PHPUnit_Framework_Assert::assertNotContains($text, $this->response, "REST response contains");
 }
Example #26
0
 /**
  * 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");
 }
Example #27
0
 /**
  * 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);
 }
Example #28
0
 /**
  * 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());
 }
Example #29
0
/**
 * 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);
}
Example #30
0
 public function notContains($needle)
 {
     a::assertNotContains($needle, $this->actual, $this->description);
 }