本文整理汇总了PHP中not函数的典型用法代码示例。如果您正苦于以下问题:PHP not函数的具体用法?PHP not怎么用?PHP not使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了not函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: testGetUnfulfilledRequests
public function testGetUnfulfilledRequests()
{
Factory::create('Giftertipster\\Entity\\Eloquent\\User', ['permissions' => []]);
Factory::create('Giftertipster\\Entity\\Eloquent\\Product');
Factory::create('Giftertipster\\Entity\\Eloquent\\Product');
$seed_request1 = Factory::create('Giftertipster\\Entity\\Eloquent\\ProductDeleteRequest', ['user_id' => 1, 'product_id' => 1, 'is_fulfilled' => 1, 'delete_type' => 'delete']);
$seed_request2 = Factory::create('Giftertipster\\Entity\\Eloquent\\ProductDeleteRequest', ['user_id' => 1, 'product_id' => 2, 'is_fulfilled' => 0, 'delete_type' => 'delete']);
$repo = $this->app->make('Giftertipster\\Repository\\ProductDeleteRequest\\EloquentProductDeleteRequestRepository');
$requests = $repo->getUnfulfilledRequests();
assertThat($requests, not(emptyArray()));
assertThat($requests[0], hasKeyValuePair('id', 2));
assertThat($requests[0], hasKeyValuePair('is_fulfilled', 0));
}
开发者ID:ryanrobertsname,项目名称:giftertipster.com,代码行数:13,代码来源:EloquentProductDeleteRequestRepositoryTest.php
示例17: testSubProductForCartAddWorks
public function testSubProductForCartAddWorks()
{
$sub_product = Factory::create('Giftertipster\\Entity\\Eloquent\\SubProduct', ['id' => 1, 'vendor_id' => 'asin stub', 'offer_listing_id' => 'offer listing id stub']);
$image = Factory::make('Giftertipster\\Entity\\Eloquent\\Image', ['category' => 'variation']);
$image2 = Factory::make('Giftertipster\\Entity\\Eloquent\\Image', ['category' => 'primary']);
$sub_product->images()->save($image);
$sub_product->images()->save($image2);
$sub_product2 = Factory::create('Giftertipster\\Entity\\Eloquent\\SubProduct');
$sub_product_repo = $this->app->make('Giftertipster\\Repository\\SubProduct\\EloquentSubProductRepository');
$result_sub_product = $sub_product_repo->subProductDataForCartAdd(1);
assertThat($result_sub_product, hasKeyValuePair('id', 1));
assertThat($result_sub_product, hasKey('images'));
assertThat($result_sub_product['images'], not(emptyArray()));
}
开发者ID:ryanrobertsname,项目名称:giftertipster.com,代码行数:14,代码来源:EloquentSubProductRepositoryTest.php
示例18: createFakeRow
/**
* Create a row with fake values
*
* @param array $fieldConfiguration As taken from Garp_Model_Db::getConfiguration()
* @param array $defaultValues Any values you want to provide yourself
* @return array
*/
public function createFakeRow(array $fieldConfiguration, array $defaultValues = array())
{
$out = array();
// TODO for now, filter primary keys, assuming they will be auto-generated by the database
$fieldConfiguration = array_filter($fieldConfiguration, not(array_get('primary')));
foreach ($fieldConfiguration as $field) {
$fieldName = $field['name'];
if (array_key_exists($fieldName, $defaultValues)) {
$out[$fieldName] = $defaultValues[$fieldName];
continue;
}
$out[$fieldName] = $this->getFakeValueForField($field);
}
return $out;
}
开发者ID:grrr-amsterdam,项目名称:garp3,代码行数:22,代码来源:Faker.php
示例19: insert
/**
* Interactively insert a new record
*
* @param array $args
* @return bool
*/
public function insert($args)
{
if (empty($args)) {
Garp_Cli::errorOut('Please provide a model');
return false;
}
$className = "Model_{$args[0]}";
$model = new $className();
$fields = $model->getConfiguration('fields');
$fields = array_filter($fields, not(propertyEquals('name', 'id')));
$mode = $this->_getInsertionMode();
if ($mode === 'g') {
$newData = $this->_createGibberish($fields);
} else {
$newData = array_reduce($fields, function ($acc, $cur) {
$acc[$cur['name']] = Garp_Cli::prompt($cur['name']) ?: null;
return $acc;
}, array());
}
$id = $model->insert($newData);
Garp_Cli::lineOut("Record created: #{$id}");
return true;
}
开发者ID:grrr-amsterdam,项目名称:garp3,代码行数:29,代码来源:Models.php
示例20: testEvaluatesToFalseIfArgumentDoesntMatchType
public function testEvaluatesToFalseIfArgumentDoesntMatchType()
{
assertThat(array(), not(booleanValue()));
assertThat(5, not(booleanValue()));
assertThat('foo', not(booleanValue()));
}
开发者ID:zhangjingli35,项目名称:hamcrest,代码行数:6,代码来源:IsBooleanTest.php
注:本文中的not函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论