當前位置: 首頁>>代碼示例>>PHP>>正文


PHP not函數代碼示例

本文整理匯總了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());
 }
開發者ID:ryanrobertsname,項目名稱:giftertipster.com,代碼行數:7,代碼來源:EloquentAnalyticsRepositoryTest.php

示例2: testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject

 public function testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject()
 {
     $o1 = new stdClass();
     $o2 = new stdClass();
     assertThat($o1, identicalTo($o1));
     assertThat($o2, not(identicalTo($o1)));
 }
開發者ID:zhangjingli35,項目名稱:hamcrest,代碼行數:7,代碼來源:IsIdenticalTest.php

示例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()));
 }
開發者ID:zhangjingli35,項目名稱:hamcrest,代碼行數:7,代碼來源:IsNullTest.php

示例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'));
 }
開發者ID:cruni505,項目名稱:prestomed,代碼行數:7,代碼來源:DescribedAsTest.php

示例5: testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject

 public function testEvaluatesToTrueIfArgumentIsReferenceToASpecifiedObject()
 {
     $o1 = new \stdClass();
     $o2 = new \stdClass();
     assertThat($o1, sameInstance($o1));
     assertThat($o2, not(sameInstance($o1)));
 }
開發者ID:EnmanuelCode,項目名稱:backend-laravel,代碼行數:7,代碼來源:IsSameTest.php

示例6: testEvaluatesToFalseIfArgumentDoesntMatchType

 public function testEvaluatesToFalseIfArgumentDoesntMatchType()
 {
     assertThat(false, not(numericValue()));
     assertThat('foo', not(numericValue()));
     assertThat('foo5', not(numericValue()));
     assertThat('5foo', not(numericValue()));
 }
開發者ID:zhangjingli35,項目名稱:hamcrest,代碼行數:7,代碼來源:IsNumericTest.php

示例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)));
 }
開發者ID:DanielDobre,項目名稱:fossology,代碼行數:7,代碼來源:LicenseMapTest.php

示例8: testDifferentStopwatchesDoNotShareState

 public function testDifferentStopwatchesDoNotShareState()
 {
     $firstStopwatch = stopwatch();
     usleep(100);
     $secondStopwatch = stopwatch();
     assertThat($this->getElapsedSeconds($firstStopwatch), not($this->getElapsedSeconds($secondStopwatch)));
 }
開發者ID:zdenekdrahos,項目名稱:profiler-tools,代碼行數:7,代碼來源:GivenStopwatchTest.php

示例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')));
 }
開發者ID:zhangjingli35,項目名稱:hamcrest,代碼行數:8,代碼來源:IsInstanceOfTest.php

示例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()));
 }
開發者ID:Ceciceciceci,項目名稱:MySJSU-Class-Registration,代碼行數:8,代碼來源:IsScalarTest.php

示例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')));
 }
開發者ID:zhangjingli35,項目名稱:hamcrest,代碼行數:10,代碼來源:IsTypeOfTest.php

示例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)));
 }
開發者ID:zhangjingli35,項目名稱:hamcrest,代碼行數:11,代碼來源:IsEqualTest.php

示例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')));
 }
開發者ID:estebanmatias92,項目名稱:pull-automatically-galleries,代碼行數:12,代碼來源:GalleryTest.php

示例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()));
 }
開發者ID:mikeSimonson,項目名稱:hamcrest-php,代碼行數:12,代碼來源:IsNumericTest.php

示例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'));
 }
開發者ID:brtriver,項目名稱:dbup,代碼行數:13,代碼來源:ApplicationTest.php


注:本文中的not函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。