当前位置: 首页>>代码示例>>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;未经允许,请勿转载。