本文整理汇总了PHP中PHPUnit_Framework_Assert::assertNotEquals方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertNotEquals方法的具体用法?PHP PHPUnit_Framework_Assert::assertNotEquals怎么用?PHP PHPUnit_Framework_Assert::assertNotEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertNotEquals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toEqual
public function toEqual($expected)
{
if ($this->negate) {
a::assertNotEquals($expected, $this->actual);
} else {
a::assertEquals($expected, $this->actual);
}
}
示例2: notEquals
public function notEquals($expected)
{
if (!$this->isFileExpectation) {
a::assertNotEquals($expected, $this->actual, $this->description);
} else {
a::assertFileNotEquals($expected, $this->actual, $this->description);
}
}
示例3: processAssert
/**
* Assert that created CMS block non visible on frontend category page
* (in order to assign block to category: go to category page> Display settings> CMS Block)
*
* @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('category', ['dataset' => 'default_subcategory', 'data' => ['display_mode' => 'Static block and products', 'landing_page' => $cmsBlock->getTitle()]]);
$category->persist();
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategoryByName($category->getName());
$categoryViewContent = $catalogCategoryView->getViewBlock()->getContent();
\PHPUnit_Framework_Assert::assertNotEquals($cmsBlock->getContent(), $categoryViewContent, 'Wrong block content on category is displayed.');
}
示例4: testGetPublicKeyFromNode
public function testGetPublicKeyFromNode()
{
$adapter = $this->getAdapter();
$publicKey = $this->getPublicKey();
Assert::assertNotEquals($publicKey, $adapter->getPublicKey());
$data = new DOMDocument();
$data->load(__DIR__ . '/_files/basic-doc-signed.xml');
Assert::assertEquals($publicKey, $adapter->getPublicKey($data));
}
示例5: assert
/**
* Assert that shopping cart subtotal not equals with grand total.
*
* @return void
*/
protected function assert()
{
$subTotal = $this->checkoutCart->getTotalsBlock()->getSubtotal();
$grandTotal = $this->checkoutCart->getTotalsBlock()->getGrandTotal();
if ($this->checkoutCart->getTotalsBlock()->isVisibleShippingPriceBlock()) {
$shippingPrice = $this->checkoutCart->getTotalsBlock()->getShippingPrice();
$grandTotal = number_format($grandTotal - $shippingPrice, 2);
}
\PHPUnit_Framework_Assert::assertNotEquals($subTotal, $grandTotal, 'Shopping cart subtotal: \'' . $subTotal . '\' equals with grand total: \'' . $grandTotal . '\'');
}
示例6: testPublishAlteredMessage
public function testPublishAlteredMessage()
{
$args = ['Message' => $originalMessage = 'MyOriginalMessage'];
$this->snsClient->method('__call')->with('publish')->willReturnCallback(function ($name, array $args) use($originalMessage) {
$params = array_key_exists(0, $args) ? $args[0] : [];
\PHPUnit_Framework_Assert::assertNotEquals($originalMessage, $params['Message']);
return new Result();
});
$actual = $this->sut->publish($args);
self::assertInstanceOf(Result::class, $actual);
}
示例7: testAddUser
public function testAddUser()
{
// insert
$user_repo = $this->app->make('App\\Repositories\\UserRepository');
$created_user_model = $user_repo->create($this->app->make('\\UserHelper')->sampleDBVars());
// load from repo
$loaded_user_model = $user_repo->findByUuid($created_user_model['uuid']);
PHPUnit::assertNotEmpty($loaded_user_model);
PHPUnit::assertEquals($created_user_model['id'], $loaded_user_model['id']);
PHPUnit::assertEquals('sample@tokenly.co', $loaded_user_model['email']);
PHPUnit::assertNotEquals('foo', $loaded_user_model['password']);
}
示例8: test
public function test()
{
$object = new UserDefault();
$type = UserDefault::class;
$metadata = new ObjectMetadata($object);
PHPUnit::assertEquals($type, $metadata->getType());
PHPUnit::assertNotEquals(10, $object->getId());
$metadata->setValue($object, 'id', 10);
PHPUnit::assertEquals(10, $object->getId());
PHPUnit::assertEquals(new \ReflectionClass($object), $metadata->getReflectionClass());
try {
$metadata->getProperty('thisPropertyDoesNotExists', true);
PHPUnit::fail('Must raise an exception');
} catch (\RuntimeException $ex) {
}
$property = $metadata->getProperty('thisPropertyDoesNotExists');
PHPUnit::assertNull($property);
$properties = $metadata->getProperties();
$type = $metadata->getType();
$object = unserialize(serialize($metadata));
PHPUnit::assertEquals($properties, $object->getProperties());
PHPUnit::assertEquals($type, $object->getType());
PHPUnit::assertEquals($metadata, $object);
}
示例9: iDonTSeeResponseHeaderWithValue
/**
* Then I (?:don\'t|do not) see "<header>" header with "<value>" value
*/
public function iDonTSeeResponseHeaderWithValue($header, $value)
{
Assertion::assertNotEquals($value, $this->restClient->getResponseHeader($header), "Unexpected '{$header}' header found with '{$this->restClient->getResponseHeader($header)}' value");
}
示例10: processAssert
/**
* Assert that first item in grid is not the same on ascending and descending sorting
*
* @param array $sortingResults
*/
public function processAssert(array $sortingResults)
{
foreach ($sortingResults as $columnName => $sortingResult) {
\PHPUnit_Framework_Assert::assertNotEquals($sortingResult['firstIdAfterFirstSoring'], $sortingResult['firstIdAfterSecondSoring'], sprintf('Sorting for "%s" column have not changed the first item of grid!', $columnName));
}
}
示例11: theCommandShouldFail
/**
* @Then /^the command should fail$/
*/
public function theCommandShouldFail()
{
$exitCode = $this->applicationTester->getLastExitCode();
\PHPUnit_Framework_Assert::assertNotEquals(0, $exitCode, 'Command exited with code ' . $exitCode);
}
示例12: dontSeeInField
/**
* Checks the value in field is not equal to value passed.
* Field is searched by its id|name|label|value or CSS selector.
*
* @param $field
* @param $value
*/
public function dontSeeInField($field, $value)
{
$node = $this->session->getPage()->findField($field);
if (!$node) {
return \PHPUnit_Framework_Assert::fail(", field not found");
}
\PHPUnit_Framework_Assert::assertNotEquals($this->escape($value), $node->getValue());
}
示例13: thereShouldBeALinkTitledWithoutNoFollow
/**
* @Then there should be a link titled :title without "nofollow"
*/
public function thereShouldBeALinkTitledWithoutNoFollow($title)
{
$element = $this->assertSession()->elementExists('css', sprintf('a:contains("%s")', $title));
if (!$element->hasAttribute('rel')) {
return;
}
Assert::assertNotEquals('nofollow', $element->getAttribute('rel'), 'The link\'s "rel" attribute should not match "nofollow"');
}
示例14: itShouldFail
/**
* Checks whether previously runned command failed|passed.
*
* @Then /^it should (fail|pass)$/
*
* @param string $success "fail" or "pass"
*/
public function itShouldFail($success)
{
if ('fail' === $success) {
\PHPUnit_Framework_Assert::assertNotEquals(0, $this->return);
} else {
\PHPUnit_Framework_Assert::assertEquals(0, $this->return);
}
}
示例15: dontSeeQueueHasTotalCount
/**
* Check if a queue/tube does NOT have a given total number of messages
*
* ```php
* <?php
* $I->dontSeeQueueHasTotalCount('default', 10);
* ?>
* ```
*
* @param string $queue Queue Name
* @param int $expected Number of messages expected
*/
public function dontSeeQueueHasTotalCount($queue, $expected)
{
$count = $this->_getMessagesTotalCountOnQueue($queue);
$this->debug("don't see queue has total count: queue [{$queue}] has [{$count}] messages");
\PHPUnit_Framework_Assert::assertNotEquals($expected, $count);
}