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


PHP PHPUnit_Framework_TestCase::setUp方法代码示例

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


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

示例1: setUp

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->connection = Connection::get();
     $this->userBook = new UserBook($this->connection);
     $this->providerInfoBook = new ProviderInfoBook($this->connection);
     $this->providerUserBook = new ProviderUserBook($this->connection);
     foreach ($this->providerInfoBook->get() as $providerInfo) {
         $this->providerInfoBook->delete($providerInfo);
     }
     foreach ($this->userBook->get() as $user) {
         $this->userBook->delete($user);
     }
     for ($k = 0; $k < 10; $k++) {
         $user = new User();
         $user->setEnabled(RandomBook::getRandomBoolean())->setEnabledDate(RandomBook::getRandomDate())->setAccessFailedCount(rand(1, 5))->setEmail(RandomBook::getRandomEmail())->setPassword(RandomBook::getRandomString())->setPhoneNumber(RandomBook::getRandomPhoneNumber())->setTwoFactorEnabled(RandomBook::getRandomBoolean())->setUserName(RandomBook::getRandomString());
         $user->setId($this->userBook->save($user));
         $this->userList[] = $user;
         for ($k = 0; $k < 10; $k++) {
             $providerInfo = new ProviderInfo();
             $providerInfo->setName(RandomBook::getRandomString())->setAppKey(RandomBook::getRandomString())->setSecretKey(RandomBook::getRandomString());
             $providerInfo->setId((int) $this->providerInfoBook->save($providerInfo));
             $this->providerInfoList[] = $providerInfo;
             $providerUser = new ProviderUser();
             $providerUser->setUserId($user->getId())->setProviderId($providerInfo->getId())->setProviderName($providerInfo->getName())->setProviderUserId(RandomBook::getRandomString());
             $this->providerUserList[] = $providerUser;
         }
     }
 }
开发者ID:mtoolkit,项目名称:mtoolkit-entity,代码行数:33,代码来源:ProviderUserBookTest.php

示例2: setUp

 protected function setUp()
 {
     $this->Robot = new Robot();
     $this->ProtectedReflection = new Apiframework\Test\ProtectedReflection($this->Robot, new \ReflectionClass($this->Robot));
     parent::setUp();
     // TODO: Change the autogenerated stub
 }
开发者ID:apiframework,项目名称:test,代码行数:7,代码来源:ProtectedReflectionTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->node = $this->prophesize('PHPCR\\NodeInterface');
     $this->event = $this->prophesize('JMS\\Serializer\\EventDispatcher\\PreSerializeEvent');
     $this->subscriber = new PhpcrNodeSubscriber();
 }
开发者ID:frogriotcom,项目名称:ResourceRestBundle,代码行数:7,代码来源:PhpcrNodeSubscriberTest.php

示例4: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->osapiPerson = new osapiPerson('ID', 'NAME');
     $this->osapiPerson->aboutMe = 'ABOUTME';
     $this->osapiPerson->activities = 'ACTIVITIES';
     $this->osapiPerson->addresses = 'ADDRESSES';
     $this->osapiPerson->age = 'AGE';
     $this->osapiPerson->bodyType = 'BODYTYPE';
     $this->osapiPerson->books = 'BOOKS';
     $this->osapiPerson->cars = 'CARS';
     $this->osapiPerson->children = 'CHILDREN';
     $this->osapiPerson->currentLocation = 'CURRENTLOCATION';
     $this->osapiPerson->dateOfBirth = 'DATEOFBIRTH';
     $this->osapiPerson->drinker = 'HEAVILY';
     $this->osapiPerson->emails = 'EMAILS';
     $this->osapiPerson->ethnicity = 'ETHNICITY';
     $this->osapiPerson->fashion = 'FASHION';
     $this->osapiPerson->food = 'FOOD';
     $this->osapiPerson->gender = 'GENDER';
     $this->osapiPerson->happiestWhen = 'HAPPIESTWHEN';
     $this->osapiPerson->hasApp = 'HASAPP';
     $this->osapiPerson->heroes = 'HEROES';
     $this->osapiPerson->humor = 'HUMOR';
     $this->osapiPerson->interests = 'INTERESTS';
     $this->osapiPerson->jobInterests = 'JOBINTERESTS';
     $this->osapiPerson->jobs = 'JOBS';
     $this->osapiPerson->languagesSpoken = 'LANGUAGESSPOKEN';
     $this->osapiPerson->livingArrangement = 'LIVINGARRANGEMENT';
     $this->osapiPerson->lookingFor = 'FRIENDS';
     $this->osapiPerson->movies = 'MOVIES';
     $this->osapiPerson->music = 'MUSIC';
     $this->osapiPerson->networkPresence = 'NETWORKPRESENCE';
     $this->osapiPerson->nickname = 'NICKNAME';
     $this->osapiPerson->pets = 'PETS';
     $this->osapiPerson->phoneNumbers = 'PHONENUMBERS';
     $this->osapiPerson->politicalViews = 'POLITICALVIEWS';
     $this->osapiPerson->profileSong = 'PROFILESONG';
     $this->osapiPerson->profileUrl = 'PROFILEURL';
     $this->osapiPerson->profileVideo = 'PROFILEVIDEO';
     $this->osapiPerson->quotes = 'QUOTES';
     $this->osapiPerson->relationshipStatus = 'RELATIONSHIPSTATUS';
     $this->osapiPerson->religion = 'RELIGION';
     $this->osapiPerson->romance = 'ROMANCE';
     $this->osapiPerson->scaredOf = 'SCAREDOF';
     $this->osapiPerson->schools = 'SCHOOLS';
     $this->osapiPerson->sexualOrientation = 'SEXUALORIENTATION';
     $this->osapiPerson->smoker = 'SMOKER';
     $this->osapiPerson->sports = 'SPORTS';
     $this->osapiPerson->status = 'STATUS';
     $this->osapiPerson->tags = 'TAGS';
     $this->osapiPerson->thumbnailUrl = 'THUMBNAILSURL';
     $this->osapiPerson->timeZone = 'TIMEZONE';
     $this->osapiPerson->turnOffs = 'TURNOFFS';
     $this->osapiPerson->turnOns = 'TURNONS';
     $this->osapiPerson->tvShows = 'TVSHOWS';
     $this->osapiPerson->urls = 'URLS';
     $this->osapiPerson->isOwner = 'ISOWNER';
     $this->osapiPerson->isViewer = 'ISVIEWER';
 }
开发者ID:serrg1994,项目名称:opensocial-php-client,代码行数:63,代码来源:osapiPersonTest.php

示例5: setUp

 protected function setUp()
 {
     parent::setUp();
     // by default the rss transformer gets not added. We must set a higher
     // priority because else the XmlArray transformer would be used
     Environment::getService('transformer_manager')->addTransformer(new Transformer\Rss(), 24);
 }
开发者ID:seytar,项目名称:psx,代码行数:7,代码来源:RssTest.php

示例6: setUp

 public function setUp()
 {
     parent::setUp();
     // Just testing with the brewery db api (not affiliated....)
     $this->client = new \Asylum\Client("http://api.brewerydb.com/v2/", "publickey", "privatekey");
     $this->data = array('type' => "beer", 'q' => "Sam Adams");
 }
开发者ID:davewid,项目名称:asylum,代码行数:7,代码来源:ClientTest.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     if (!$this->loginPartnerIds) {
         $this->loginPartnerIds = $this->getLoginPartners();
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:7,代码来源:TestKuserMigration.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     $repositoryConnection = $this->getMockBuilder('\\SMW\\SPARQLStore\\RepositoryConnection')->disableOriginalConstructor()->getMock();
     $this->store = $this->getMockBuilder('\\SMW\\SPARQLStore\\SPARQLStore')->disableOriginalConstructor()->getMock();
     $this->store->expects($this->any())->method('getConnection')->will($this->returnValue($repositoryConnection));
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:7,代码来源:SPARQLStoreFactoryTest.php

示例9: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->dao = $this->getMock('FA\\Dao\\UserDao', array('findByEmail', 'recordLogin'), array(), '', false);
     $this->adapter = new DbAdapter($this->dao);
     $this->user = array('id' => '1', 'email' => 'user@example.com', 'password_hash' => '$2y$12$pZg9j8DBSIP2R/vfDzTQOeIt5n57r5VigCUl/HH.FrBOadi3YhdPS', 'last_login' => null);
 }
开发者ID:neophyt3,项目名称:flaming-archer,代码行数:11,代码来源:DbAdapterTest.php

示例10: setUp

 protected function setUp()
 {
     $this->_apiFrontController = $this->getMockBuilder('Mage_Webapi_Controller_Front')->disableOriginalConstructor()->getMock();
     $this->_objectManager = $this->getMockBuilder('Magento_ObjectManager')->disableOriginalConstructor()->getMock();
     $this->_factory = new Mage_Webapi_Controller_Response_Factory($this->_apiFrontController, $this->_objectManager);
     parent::setUp();
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例11: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->_db = new Zend_Db_Adapter_Pdo_Sqlite(array('dbname' => dirname(__FILE__) . '/../_files/test.sqlite'));
     $this->_query = $this->_db->select()->from('test');
     $this->_adapter = new Zend_Paginator_Adapter_DbSelect($this->_query);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:10,代码来源:DbSelectTest.php

示例12: setUp

 protected function setUp()
 {
     spl_autoload_unregister(array($GLOBALS['autoloader'], 'autoload'));
     $this->_autoloader = new Autoloader(array(APP_PATH . '/../tests/library/Supermon/src'));
     spl_autoload_register(array($this->_autoloader, 'autoload'));
     parent::setUp();
 }
开发者ID:Israelmv01,项目名称:SupermonMvc,代码行数:7,代码来源:AutoloaderTest.php

示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     Clock::freeze('2014-01-01 11:11:11');
     StreamStub::register('test');
     $this->logger = new StdOutputLogger('TEST', 'default', 'test');
 }
开发者ID:letsdrink,项目名称:ouzo,代码行数:7,代码来源:StdOutputLoggerTest.php

示例14: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->Image = new RW_Image();
     // path para as imagens
     $this->imgPath = realpath(TEST_ROOT . '/assets/_files/');
 }
开发者ID:realejo,项目名称:library-zf1,代码行数:10,代码来源:ImageTest.php

示例15: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->applicationFactory = ApplicationFactory::getInstance();
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
     $this->applicationFactory->registerObject('Store', $store);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:7,代码来源:LinksUpdateConstructedTest.php


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