本文整理汇总了PHP中not函数的典型用法代码示例。如果您正苦于以下问题:PHP not函数的具体用法?PHP not怎么用?PHP not使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了not函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTruncateCategoryAnalytics
public function testTruncateCategoryAnalytics()
{
Factory::create('Giftertipster\\Entity\\Eloquent\\Analytic\\CategoryAnalytic');
assertThat(CategoryAnalytic::get()->toArray(), not(emptyArray()));
$this->repo->truncateCategoryAnalytics();
assertThat(CategoryAnalytic::get()->toArray(), emptyArray());
}
示例2: testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject
public function testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject()
{
$o1 = new stdClass();
$o2 = new stdClass();
assertThat($o1, identicalTo($o1));
assertThat($o2, not(identicalTo($o1)));
}
示例3: testEvaluatesToTrueIfArgumentIsNull
public function testEvaluatesToTrueIfArgumentIsNull()
{
assertThat(null, nullValue());
assertThat(self::ANY_NON_NULL_ARGUMENT, not(nullValue()));
assertThat(self::ANY_NON_NULL_ARGUMENT, notNullValue());
assertThat(null, not(notNullValue()));
}
示例4: testDelegatesMatchingToAnotherMatcher
public function testDelegatesMatchingToAnotherMatcher()
{
$m1 = describedAs('irrelevant', anything());
$m2 = describedAs('irrelevant', not(anything()));
$this->assertTrue($m1->matches(new \stdClass()));
$this->assertFalse($m2->matches('hi'));
}
示例5: testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject
public function testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject()
{
$o1 = new \stdClass();
$o2 = new \stdClass();
assertThat($o1, sameInstance($o1));
assertThat($o2, not(sameInstance($o1)));
}
示例6: testEvaluatesToFalseIfArgumentDoesntMatchType
public function testEvaluatesToFalseIfArgumentDoesntMatchType()
{
assertThat(false, not(numericValue()));
assertThat('foo', not(numericValue()));
assertThat('foo5', not(numericValue()));
assertThat('5foo', not(numericValue()));
}
示例7: testGetTopLevelLicenseRefs
function testGetTopLevelLicenseRefs()
{
$licenseMap = new LicenseMap($this->dbManager, $this->groupId, LicenseMap::CONCLUSION);
$topLevelLicenses = $licenseMap->getTopLevelLicenseRefs();
assertThat($topLevelLicenses, hasItemInArray(new LicenseRef(1, 'One', 'One-1')));
assertThat($topLevelLicenses, not(hasKeyInArray(2)));
}
示例8: testDifferentStopwatchesDoNotShareState
public function testDifferentStopwatchesDoNotShareState()
{
$firstStopwatch = stopwatch();
usleep(100);
$secondStopwatch = stopwatch();
assertThat($this->getElapsedSeconds($firstStopwatch), not($this->getElapsedSeconds($secondStopwatch)));
}
示例9: testEvaluatesToFalseIfArgumentIsNotAnObject
public function testEvaluatesToFalseIfArgumentIsNotAnObject()
{
assertThat(null, not(anInstanceOf('Hamcrest_Core_SampleBaseClass')));
assertThat(false, not(anInstanceOf('Hamcrest_Core_SampleBaseClass')));
assertThat(5, not(anInstanceOf('Hamcrest_Core_SampleBaseClass')));
assertThat('foo', not(anInstanceOf('Hamcrest_Core_SampleBaseClass')));
assertThat(array(1, 2, 3), not(anInstanceOf('Hamcrest_Core_SampleBaseClass')));
}
示例10: testEvaluatesToFalseIfArgumentDoesntMatchType
public function testEvaluatesToFalseIfArgumentDoesntMatchType()
{
assertThat(null, not(scalarValue()));
assertThat(array(), not(scalarValue()));
assertThat(array(5), not(scalarValue()));
assertThat(tmpfile(), not(scalarValue()));
assertThat(new \stdClass(), not(scalarValue()));
}
示例11: testEvaluatesToFalseIfArgumentDoesntMatchType
public function testEvaluatesToFalseIfArgumentDoesntMatchType()
{
assertThat(false, not(typeOf('array')));
assertThat(array('5', 5), not(typeOf('boolean')));
assertThat(5.2, not(typeOf('integer')));
assertThat(5, not(typeOf('double')));
assertThat(false, not(typeOf('null')));
assertThat('a string', not(typeOf('resource')));
assertThat(tmpfile(), not(typeOf('string')));
}
示例12: testRecursivelyTestsElementsOfArrays
public function testRecursivelyTestsElementsOfArrays()
{
$i1 = array(array(1, 2), array(3, 4));
$i2 = array(array(1, 2), array(3, 4));
$i3 = array(array(5, 6), array(7, 8));
$i4 = array(array(1, 2, 3, 4), array(3, 4));
assertThat($i1, equalTo($i1));
assertThat($i2, equalTo($i1));
assertThat($i3, not(equalTo($i1)));
assertThat($i4, not(equalTo($i1)));
}
示例13: testFilterGalleryAttributesFromMetaFieldsWhenSaves
public function testFilterGalleryAttributesFromMetaFieldsWhenSaves()
{
$attributes = ['post_content' => 'Dummy Content.', 'post_title' => 'Dummy Title', 'post_date' => date('Y-m-d H:i:s'), 'pal_user_id' => 1, 'pal_gallery_id' => 1];
$gallery = new Gallery($attributes);
$gallery->save();
$attributes = $gallery->getAttributes();
assertThat($attributes, hasKey('post_content'));
assertThat($attributes, hasKey('post_title'));
assertThat($attributes, hasKey('post_date'));
assertThat($attributes, not(hasKey('pal_user_id')));
assertThat($attributes, not(hasKey('pal_gallery_id')));
}
示例14: testEvaluatesToFalseIfArgumentDoesntMatchType
public function testEvaluatesToFalseIfArgumentDoesntMatchType()
{
assertThat(false, not(numericValue()));
assertThat('foo', not(numericValue()));
assertThat('foo5', not(numericValue()));
assertThat('5foo', not(numericValue()));
assertThat('0x42A04G', not(numericValue()));
// G is not in the hexadecimal range.
assertThat('1x42A04', not(numericValue()));
// 1x is not a valid hexadecimal sequence.
assertThat('0x', not(numericValue()));
}
示例15: testGetStatuses
public function testGetStatuses()
{
$this->app->sqlFilesDir = __DIR__ . '/sql';
$this->app->appliedFilesDir = __DIR__ . '/.dbup/applied';
$statuses = $this->app->getStatuses();
assertThat(count($statuses), is(3));
assertThat($statuses[0]->appliedAt, is(not('')));
assertThat($statuses[0]->file->getFileName(), is('V1__sample_select.sql'));
assertThat($statuses[1]->appliedAt, is(''));
assertThat($statuses[1]->file->getFileName(), is('V3__sample3_select.sql'));
assertThat($statuses[2]->appliedAt, is(''));
assertThat($statuses[2]->file->getFileName(), is('V12__sample12_select.sql'));
}