当前位置: 首页>>代码示例>>PHP>>正文


PHP lime_test::isnt方法代码示例

本文整理汇总了PHP中lime_test::isnt方法的典型用法代码示例。如果您正苦于以下问题:PHP lime_test::isnt方法的具体用法?PHP lime_test::isnt怎么用?PHP lime_test::isnt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lime_test的用法示例。


在下文中一共展示了lime_test::isnt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

$keys['find'] = myQuery::$lastQueryCacheHash;
Doctrine::getTable('AdminUser')->findAll();
$keys['find_all'] = myQuery::$lastQueryCacheHash;
Doctrine::getTable('AdminUser')->findById(1);
$keys['find_by_id'] = myQuery::$lastQueryCacheHash;
Doctrine::getTable('AdminUser')->findOneById(1);
$keys['find_one_by_id'] = myQuery::$lastQueryCacheHash;
Doctrine::getTable('AdminUser')->findByIdAndUsername(1, 'admin');
$keys['find_by_id_and_username'] = myQuery::$lastQueryCacheHash;
Doctrine::getTable('AdminUser')->findOneByIdAndUsername(1, 'admin');
$keys['find_one_by_id_and_username'] = myQuery::$lastQueryCacheHash;
Doctrine::getTable('AdminUser')->findByUsernameAndPassword('admin', 'password');
$keys['find_by_username_and_password'] = myQuery::$lastQueryCacheHash;
Doctrine::getTable('AdminUser')->findOneByUsernameAndPassword('admin', 'password');
$keys['find_one_by_username_and_password'] = myQuery::$lastQueryCacheHash;
$t->isnt($keys['find'], $keys['find_all'], '->find() and ->findAll() generates different query cache keys');
$t->isnt($keys['find'], $keys['find_by_id'], '->find() and ->findById() generates different query cache keys');
$t->is($keys['find'], $keys['find_one_by_id'], '->find() and ->findOneById() generates same query cache keys');
$t->isnt($keys['find'], $keys['find_by_id_and_username'], '->find() and ->findByIdAndUsername() generates different query cache keys');
$t->isnt($keys['find'], $keys['find_one_by_id_and_username'], '->find() and ->findOneByIdAndUsername() generates different query cache keys');
$t->isnt($keys['find'], $keys['find_by_username_and_password'], '->find() and ->findByUsernameAndPassword() generates different query cache keys');
$t->isnt($keys['find'], $keys['find_one_by_username_and_password'], '->find() and ->findOneByUsernameAndPassword() generates different query cache keys');
$t->isnt($keys['find_all'], $keys['find_by_id'], '->findAll() and ->findById() generates different query cache keys');
$t->isnt($keys['find_all'], $keys['find_one_by_id'], '->findAll() and ->findOneById() generates different query cache keys');
$t->isnt($keys['find_all'], $keys['find_by_id_and_username'], '->findAll() and ->findByIdAndUsername() generates different query cache keys');
$t->isnt($keys['find_all'], $keys['find_one_by_id_and_username'], '->findAll() and ->findOneByIdAndUsername() generates different query cache keys');
$t->isnt($keys['find_all'], $keys['find_by_username_and_password'], '->findAll() and ->findByUsernameAndPassword() generates different query cache keys');
$t->isnt($keys['find_all'], $keys['find_one_by_username_and_password'], '->findAll() and ->findOneByUsernameAndPassword() generates different query cache keys');
$t->isnt($keys['find_by_id'], $keys['find_one_by_id'], '->findById() and ->findOneById() generates different query cache keys');
$t->isnt($keys['find_by_id'], $keys['find_by_id_and_username'], '->findById() and ->findByIdAndUsername() generates different query cache keys');
$t->isnt($keys['find_by_id'], $keys['find_one_by_id_and_username'], '->findById() and ->findOneById() generates different query cache keys');
开发者ID:te-koyama,项目名称:openpne,代码行数:31,代码来源:opDoctrineQueryTest.php

示例2: dirname

Beware that the tables for these models will be emptied by the tests, so use a test database connection.
*/

include dirname(__FILE__).'/../../bootstrap.php';

$t = new lime_test(34, new lime_output_color());

$t->diag('getUniqueIdentifier()');

$id1 = DbFinder::from('Article')->where('Title', 'foo')->getUniqueIdentifier();
$id2 = DbFinder::from('Article')->where('Title', 'foo')->getUniqueIdentifier();
$t->is($id1, $id2, 'Similar queries get the same unique identifier');

$id1 = DbFinder::from('Article')->where('Title', 'foo')->getUniqueIdentifier();
$id2 = DbFinder::from('Article')->where('Title', 'bar')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'Different queries get a different unique identifier');

$id1 = DbFinder::from('Article')->getUniqueIdentifier();
$id2 = DbFinder::from('Comment')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'unique identifier takes main model class into account');

$id1 = DbFinder::from('Article')->where('Title', 'foo')->with('Category')->getUniqueIdentifier();
$id2 = DbFinder::from('Article')->where('Title', 'foo')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'unique identifier takes with classes into account');

$id1 = DbFinder::from('Article')->where('Title', 'foo')->withColumn('Category.Name')->getUniqueIdentifier();
$id2 = DbFinder::from('Article')->where('Title', 'foo')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'unique identifier takes with columns into account');

$id1 = DbFinder::from('Article')->where('Title', 'foo')->leftJoin('Category')->withColumn('Category.Name')->getUniqueIdentifier();
$id2 = DbFinder::from('Article')->where('Title', 'foo')->withColumn('Category.Name')->getUniqueIdentifier();
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:31,代码来源:sfPropelFinderCacheTest.php

示例3: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/Doctrine.php';
$t = new lime_test(14, new lime_output_color());
$taxs = Doctrine::getTable('Taxonomy')->findOneByName('Falco Peregrinus eliticus');
$t->info('findWithParents($id)');
$taxa = Doctrine::getTable('Taxonomy')->findWithParents($taxs->getId());
$t->isnt($taxa, null, 'we got a taxa');
$t->is($taxa->count(), 9, 'we got all parent of the taxa');
$t->is($taxa[7]->getId(), $taxs->getParentRef(), 'Parent is correct');
$t->is($taxa[1]->Level->__toString(), 'kingdom', 'get Level');
$t->is($taxs->getNameWithFormat(), '<i>Falco Peregrinus eliticus</i>', 'get Name without extinct');
$taxs->setExtinct('true');
$t->is($taxs->getNameWithFormat(), '<i>Falco Peregrinus eliticus</i> †', 'get Name without extinct');
$t->is(DarwinTable::getFilterForTable('classification_syonymies'), "ClassificationSyonymiesFormFilter", 'Filter Form name');
$t->is(DarwinTable::getFormForTable('classification_syonymies'), "ClassificationSyonymiesForm", 'Form Name');
$t->is(DarwinTable::getModelForTable('classification_syonymies'), "ClassificationSyonymies", 'Model Name');
$t->is(Doctrine::getTable('Taxonomy')->find(4)->toArray(), true, 'We got the record with find');
$t->is(Doctrine::getTable('Taxonomy')->find(-1)->toArray(), true, 'Record bellow 0 are found  with find');
$keywords = Doctrine::getTable('ClassificationKeywords')->findForTable('taxonomy', 4);
$t->is(count($keywords), 0, 'No KW per default');
$kw_full = ClassificationKeywords::getTags('taxonomy');
$avail_kw = array_keys($kw_full);
$kw = new ClassificationKeywords();
$kw->setReferencedRelation('taxonomy');
$kw->setRecordId(4);
$kw->setKeywordType($avail_kw[1]);
$kw->setKeyword('Falco Peregrinus');
$kw->save();
$keywords = Doctrine::getTable('ClassificationKeywords')->findForTable('taxonomy', 4);
$t->is(count($keywords), 1, 'The new Keyword');
开发者ID:naturalsciences,项目名称:Darwin,代码行数:31,代码来源:TaxonomyTableTest.php

示例4: dirname

<?php

$app = 'sympal';
require_once dirname(__FILE__) . '/../../../bootstrap/unit.php';
$t = new lime_test(5);
$t->info('1 - Test that the delete recurses on the application level to the sfSympalContent records');
$site = Doctrine_Core::getTable('sfSympalSite')->findOneBySlug('sympal');
$pages = Doctrine_Core::getTable('sfSympalPage')->createQuery()->execute();
$t->isnt(count($site->Content), 0, 'Sanity check: the sfSympalSite record has at least one Content record');
$t->isnt(count($pages), 0, 'Sanity check: We begin with more than 0 sfSympalPage objects');
$site->delete();
$site->refreshRelated('Content');
$pages = Doctrine_Core::getTable('sfSympalPage')->createQuery()->execute();
$t->is(count($site->Content), 0, 'The site now has no content. This would happen with or without the application-level delete recursion');
$t->is(count($pages), 0, 'All of the sfSympalPage records are gone due to the application-level delete recursion onto sfSympalContent');
$t->info('2 - Quick check on ->deleteApplication');
$site->deleteApplication();
$t->is(file_exists(sfConfig::get('sf_app_dir')), false, 'The application directory no longer exists');
开发者ID:sympal,项目名称:sympal,代码行数:18,代码来源:PluginsfSympalSiteTest.php

示例5: DCategory

$category1 = new DCategory();
$category1->setName('cat1');
$category1->save();
$article1 = new DArticle();
$article1->setTitle('aaaaa');
$article1->setCategory($category1);
$article1->save();
// Identity Map is there... No query will be issued to fetch an article Category, unless we clear the map
Doctrine::getTable('DCategory')->clear();
Doctrine::getTable('DArticle')->clear();
$finder = sfDoctrineFinder::from('DArticle');
$article = $finder->findOne();
$sql = $finder->getLatestQuery();
$article->getCategory()->getName();
$t->isnt($finder->getLatestQuery(), $sql, 'Calling a getter on a related object issues a new query');

Doctrine::getTable('DCategory')->clear();
Doctrine::getTable('DArticle')->clear();
$finder = sfDoctrineFinder::from('DArticle')->join('DCategory')->with('DCategory');
$article = $finder->findOne();
$sql = $finder->getLatestQuery();
$expectedSQL = 'SELECT d.id AS d__id, d.title AS d__title, d.category_id AS d__category_id, d2.id AS d2__id, d2.name AS d2__name FROM d_article d INNER JOIN d_category d2 ON d.category_id = d2.id LIMIT 1';
$t->is($sql, $expectedSQL, 'with() hydrates the related classes and avoids subsequent queries');
$article->getCategory()->getName();
$t->is($finder->getLatestQuery(), $sql, 'with() hydrates the related classes and avoids subsequent queries');

$t->is($article->getTitle(), 'aaaaa', 'fetching objects with a with() returns the correct main object');
$t->is($article->getCategory()->getName(), 'cat1', 'fetching objects with a with() returns the correct related object');

$finder = sfDoctrineFinder::from('DArticle')->with('DCategory');
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:30,代码来源:sfDoctrineFinderWithTest.php

示例6:

<?php

include 'lime.php';
$t = new lime_test(4, new lime_output_color());
Mapnik\DataSourceCache::registerDataSources('..\\mapnik-0.7.1\\plugins');
$data_sources = Mapnik\DatasourceCache::getPluginNames();
$t->is(is_array($data_sources), true, 'getPluginNames returns an array');
$t->is(count($data_sources), 1, 'One plugin found');
$t->is($data_sources[0], 'shape', 'Shape plugin found');
$p = new Mapnik\Parameters();
$p->set('type', 'shape');
$p->set('file', '../mapnik-0.7.1/demo/data/boundaries');
$datasource = Mapnik\DataSourceCache::createDatasource($p);
$t->isnt($datasource, null, 'Shape datasource created.');
开发者ID:roel-v,项目名称:php_mapnik,代码行数:14,代码来源:unit_tests_datasource.php

示例7: array

$t->diag('->listCredentials()');
$user->clearCredentials();
$user->addCredential('user');
$t->is($user->listCredentials(), array('user'), '->listCredentials() returns user credentials as an array');
// ->setAuthenticated() ->isAuthenticated()
$t->diag('->setAuthenticated() ->isAuthenticated()');
$t->is($user->isAuthenticated(), false, '->isAuthenticated() returns false by default');
$user->setAuthenticated(true);
$t->is($user->isAuthenticated(), true, '->isAuthenticated() returns true if the user is authenticated');
$user->setAuthenticated(false);
$t->is($user->isAuthenticated(), false, '->setAuthenticated() accepts a boolean as its first parameter');
// session id regeneration
$user->setAuthenticated(false);
$id = $storage->getSessionId();
$user->setAuthenticated(true);
$t->isnt($id, $id = $storage->getSessionId(), '->setAuthenticated() regenerates the session id if the authentication changes');
$user->setAuthenticated(true);
$t->is($storage->getSessionId(), $id, '->setAuthenticated() does not regenerate the session id if the authentication does not change');
$user->addCredential('foo');
$t->isnt($id, $id = $storage->getSessionId(), '->addCredential() regenerates the session id if a new credential is added');
$t->is($id, $storage->getSessionId(), '->addCredential() does not regenerate the session id if the credential already exists');
$user->removeCredential('foo');
$t->isnt($id, $id = $storage->getSessionId(), '->removeCredential() regenerates the session id if a credential is removed');
$t->is($id, $storage->getSessionId(), '->removeCredential() does not regenerate the session id if the credential does not exist');
// ->setTimedOut() ->getTimedOut()
$user = new sfBasicSecurityUser($dispatcher, $storage);
$t->diag('->setTimedOut() ->isTimedOut()');
$t->is($user->isTimedOut(), false, '->isTimedOut() returns false if the session is not timed out');
$user->setTimedOut();
$t->is($user->isTimedOut(), true, '->isTimedOut() returns true if the session is timed out');
// ->hasCredential()
开发者ID:mediasadc,项目名称:alba,代码行数:31,代码来源:sfBasicSecurityUserTest.php

示例8:

$msg1->save();
$topic = sfSimpleForumTopicPeer::retrieveByPk($topic->getId());
$t->is($topic->getNbPosts(), 3, 'Updating a message doesn\'t change the topic post count');
$t->is($topic->getUpdatedAt('U'), $msg3->getCreatedAt('U'), 'Updating a message doesn\'t change the topic\'s last update date');
$t->is($topic->getLatestPost()->getId(), $msg3->getId(), 'Updating a message doesn\'t change the topic\'s latest reply');
$forum = sfSimpleForumForumPeer::retrieveByPk($forum->getId());
$t->is($forum->getNbPosts(), 3, 'Updating a message doesn\'t change the forum\'s post count');
$t->is($forum->getUpdatedAt('U'), $msg3->getCreatedAt('U'), 'Updating a message doesn\'t change the forum\'s last update date');
$t->is($forum->getLatestPost()->getId(), $msg3->getId(), 'Updating a message doesn\'t change the forum\'s last reply');
$t->diag('Updating the topic');
sleep(1);
$topic = sfSimpleForumTopicPeer::retrieveByPk($topic->getId());
$topic->setTitle('this is another test');
$topic->save();
$t->is($topic->getNbPosts(), 3, 'Updating a topic doesn\'t change the topic number of replies');
$t->isnt($topic->getUpdatedAt('U'), $msg3->getCreatedAt('U'), 'Updating a topic changes the topic\'s latest update date');
$t->is($topic->getLatestPost()->getId(), $msg3->getId(), 'Updating a topic doesn\'t change the topic\'s latest reply');
$forum = sfSimpleForumForumPeer::retrieveByPk($forum->getId());
$t->is($forum->getLatestPost()->getCreatedAt('U'), $msg3->getCreatedAt('U'), 'Updating the topic doesn\'t change the forum\'s last update date');
$t->is($forum->getLatestPost()->getAuthorName(), $user3->getUsername(), 'Updating the topic doesn\'t change the forum\'s last reply author name');
$t->diag('Deleting a message from the end');
$msg3->delete();
$topic = sfSimpleForumTopicPeer::retrieveByPk($topic->getId());
$t->is($topic->getNbPosts(), 2, 'Deleting a message decrements the topic number of replies');
$t->is($topic->getUpdatedAt('U'), $msg2->getCreatedAt('U'), 'Deleting a message changes the topic\'s latest update date to the latest message creation date');
$t->is($topic->getLatestPost()->getId(), $msg2->getId(), 'Deleting a message changes the topic\'s latest reply');
$forum = sfSimpleForumForumPeer::retrieveByPk($forum->getId());
$t->is($forum->getUpdatedAt('U'), $msg2->getCreatedAt('U'), 'Deleting a message changes the forums\'s latest update date to the latest message creation date');
$t->is($forum->getLatestPost()->getId(), $msg2->getId(), 'Deleting a message changes the forums\'s latest reply');
$t->diag('Deleting a message from the middle');
$msg1->delete();
开发者ID:kriswallsmith,项目名称:sfSimpleForumPlugin,代码行数:31,代码来源:sfSimpleForumPostTest.php

示例9: sfCultureInfo

// ::getInstance()
$t->diag('::getInstance()');
$t->isa_ok(sfNumberFormatInfo::getInstance(), 'sfNumberFormatInfo', '::getInstance() returns an sfNumberFormatInfo instance');
$c = new sfCultureInfo();
$t->is(sfNumberFormatInfo::getInstance($c), $c->getNumberFormat(), '::getInstance() can take a sfCultureInfo instance as its first argument');
$t->isa_ok(sfNumberFormatInfo::getInstance('fr'), 'sfNumberFormatInfo', '::getInstance() can take a culture as its first argument');
$n = sfNumberFormatInfo::getInstance();
$n->setPattern(sfNumberFormatInfo::PERCENTAGE);
$t->is(sfNumberFormatInfo::getInstance(null, sfNumberFormatInfo::PERCENTAGE)->getPattern(), $n->getPattern(), '::getInstance() can take a formatting type as its second argument');
// ->getPattern() ->setPattern()
$t->diag('->getPattern() ->setPattern()');
$n = sfNumberFormatInfo::getInstance();
$n1 = sfNumberFormatInfo::getInstance();
$n->setPattern(sfNumberFormatInfo::CURRENCY);
$n1->setPattern(sfNumberFormatInfo::PERCENTAGE);
$t->isnt($n->getPattern(), $n1->getPattern(), '->getPattern() ->setPattern() changes the current pattern');
$n = sfNumberFormatInfo::getInstance();
$n1 = sfNumberFormatInfo::getInstance();
$n->Pattern = sfNumberFormatInfo::CURRENCY;
$n1->setPattern(sfNumberFormatInfo::CURRENCY);
$t->is($n->getPattern(), $n1->getPattern(), '->setPattern() is equivalent to ->Pattern = ');
$t->is($n->getPattern(), $n->Pattern, '->getPattern() is equivalent to ->Pattern');
// ::getCurrencyInstance()
$t->diag('::getCurrencyInstance()');
$t->is(sfNumberFormatInfo::getCurrencyInstance()->getPattern(), sfNumberFormatInfo::getInstance(null, sfNumberFormatInfo::CURRENCY)->getPattern(), '::getCurrencyInstance() is a shortcut for ::getInstance() and type sfNumberFormatInfo::CURRENCY');
// ::getPercentageInstance()
$t->diag('::getPercentageInstance()');
$t->is(sfNumberFormatInfo::getPercentageInstance()->getPattern(), sfNumberFormatInfo::getInstance(null, sfNumberFormatInfo::PERCENTAGE)->getPattern(), '::getPercentageInstance() is a shortcut for ::getInstance() and type sfNumberFormatInfo::PERCENTAGE');
// ::getScientificInstance()
$t->diag('::getScientificInstance()');
$t->is(sfNumberFormatInfo::getScientificInstance()->getPattern(), sfNumberFormatInfo::getInstance(null, sfNumberFormatInfo::SCIENTIFIC)->getPattern(), '::getScientificInstance() is a shortcut for ::getInstance() and type sfNumberFormatInfo::SCIENTIFIC');
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:sfNumberFormatInfoTest.php

示例10: dirname

Beware that the tables for these models will be emptied by the tests, so use a test database connection.
*/

include dirname(__FILE__).'/../../bootstrap.php';

$t = new lime_test(21, new lime_output_color());

$t->diag('getUniqueIdentifier()');

$id1 = DbFinder::from('DArticle')->where('Title', 'foo')->getUniqueIdentifier();
$id2 = DbFinder::from('DArticle')->where('Title', 'foo')->getUniqueIdentifier();
$t->is($id1, $id2, 'Similar queries get the same unique identifier');

$id1 = DbFinder::from('DArticle')->where('Title', 'foo')->getUniqueIdentifier();
$id2 = DbFinder::from('DArticle')->where('Title', 'bar')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'Different queries get a different unique identifier');

$id1 = DbFinder::from('DArticle')->getUniqueIdentifier();
$id2 = DbFinder::from('DComment')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'unique identifier takes main model class into account');

$id1 = DbFinder::from('DArticle')->where('Title', 'foo')->with('DCategory')->getUniqueIdentifier();
$id2 = DbFinder::from('DArticle')->where('Title', 'foo')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'unique identifier takes with classes into account');

$id1 = DbFinder::from('DArticle')->where('Title', 'foo')->withColumn('DCategory.Name')->getUniqueIdentifier();
$id2 = DbFinder::from('DArticle')->where('Title', 'foo')->getUniqueIdentifier();
$t->isnt($id1, $id2, 'unique identifier takes with columns into account');

$id1 = DbFinder::from('DArticle')->where('Title', 'foo')->leftJoin('Category')->withColumn('DCategory.Name')->getUniqueIdentifier();
$id2 = DbFinder::from('DArticle')->where('Title', 'foo')->withColumn('DCategory.Name')->getUniqueIdentifier();
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:31,代码来源:sfDoctrineFinderCacheTest.php

示例11: array

$t->diag('->getOptions() ->setOptions()');
$v->setOptions(array('required' => true, 'trim' => false));
$t->is($v->getOptions(), array('required' => true, 'trim' => false, 'empty_value' => null), '->setOptions() changes all options');
// ->getMessages()
$t->diag('->getMessages()');
$t->is($v->getMessages(), array('required' => 'Required.', 'invalid' => 'Invalid.', 'foo' => 'bar'), '->getMessages() returns an array of all error messages');
// ->getMessage()
$t->diag('->getMessage()');
$t->is($v->getMessage('required'), 'Required.', '->getMessage() returns an error message string');
$t->is($v->getMessage('nonexistant'), '', '->getMessage() returns an empty string if the message does not exist');
// ->setMessage()
$t->diag('->setMessage()');
$v->setMessage('required', 'The field is required.');
try {
    $v->clean('');
    $t->isnt($e->getMessage(), 'The field is required.', '->setMessage() changes the default error message string');
} catch (sfValidatorError $e) {
    $t->is($e->getMessage(), 'The field is required.', '->setMessage() changes the default error message string');
}
try {
    $v->setMessage('foobar', 'foo');
    $t->fail('->setMessage() throws an InvalidArgumentException if the message is not registered');
} catch (InvalidArgumentException $e) {
    $t->pass('->setMessage() throws an InvalidArgumentException if the message is not registered');
}
// ->setMessages()
$t->diag('->setMessages()');
$v->setMessages(array('required' => 'This is required!'));
$t->is($v->getMessages(), array('invalid' => 'Invalid.', 'required' => 'This is required!'), '->setMessages() changes all error messages');
// ->addMessage()
$t->diag('->addMessage()');
开发者ID:hunde,项目名称:bsc,代码行数:31,代码来源:sfValidatorBaseTest.php

示例12: dirname

<?php

include dirname(__FILE__) . '/../../bootstrap/Doctrine.php';
$t = new lime_test(4, new lime_output_color());
$t->diag('getDistinctSubType');
$p = Doctrine::getTable('Institutions')->getDistinctSubType();
$t->is($p[0]->getType(), 'Federal institution', 'Get Institutions types');
$t->diag('Find Institution');
$people = Doctrine::getTable('People')->findByFamilyName('Duchesne');
$r = Doctrine::getTable('Institutions')->findInstitution($people[0]->getId());
$t->is($r, null, 'we did not find the P');
$ugmmm = Doctrine::getTable('People')->findByFamilyName('UGMM');
$r = Doctrine::getTable('Institutions')->findInstitution($ugmmm[0]->getId());
$t->isnt($r, null, 'But ugmm is an Institutions');
$t->is($r->__toString(), 'UGMM', 'get The toString of this institution');
开发者ID:naturalsciences,项目名称:Darwin,代码行数:15,代码来源:InstitutionsTableTest.php

示例13:

<?php

include 'lime.php';
$t = new lime_test(5, new lime_output_color());
$p = new Mapnik\Parameters();
$t->isnt($p, null, 'Created parameters object');
$p->set('string_test', 'hello');
$t->is($p->get('string_test'), 'hello', 'Setter/getter with string key');
$p->set('integer_test', 5);
$t->is($p->get('integer_test'), 5, 'Setter/getter with integer key');
$p->set('double_test', 3.14);
$t->is($p->get('double_test'), 3.14, 'Setter/getter with double key');
$t->is($p->get('doesnt_exist'), null, 'Getter for unknown key returns null');
开发者ID:roel-v,项目名称:php_mapnik,代码行数:13,代码来源:unit_tests_parameters.php

示例14:

<?php

include 'lime.php';
$t = new lime_test(1, new lime_output_color());
$feature_style = new Mapnik\FeatureStyle();
$t->isnt($feature_style, null, 'FeatureStyle created OK');
$rule = new Mapnik\Rule();
$feature_style->addRule($rule);
// @todo
// PHP_ME(FeatureStyle, getRules,		NULL,	ZEND_ACC_PUBLIC)
开发者ID:roel-v,项目名称:php_mapnik,代码行数:10,代码来源:unit_tests_feature_style.php

示例15: catch

<?php

include 'lime.php';
$t = new lime_test(5, new lime_output_color());
// Default constructors
$l = new Mapnik\Layer('test layer');
$t->isnt($l, null, 'Layer constructor with one argument');
$t->isa_ok($l, 'Mapnik\\Layer', 'Layer constructor with one argument returned right type');
$l = new Mapnik\Layer('test layer');
$t->isnt($l, null, 'Layer constructor with two arguments', '+proj=latlong +datum=WGS84');
$t->isa_ok($l, 'Mapnik\\Layer', 'Layer constructor with two arguments returned right type');
try {
    $l = new Mapnik\Layer();
    $t->fail('No arguments passed to Layer constructor but no exception thrown');
} catch (Exception $e) {
    $t->pass('No arguments passed to Layer constructor, exception thrown');
}
开发者ID:roel-v,项目名称:php_mapnik,代码行数:17,代码来源:unit_tests_layer.php


注:本文中的lime_test::isnt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。