本文整理汇总了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;
}
}
}
示例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
}
示例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();
}
示例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';
}
示例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);
}
示例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");
}
示例7: setUp
protected function setUp()
{
parent::setUp();
if (!$this->loginPartnerIds) {
$this->loginPartnerIds = $this->getLoginPartners();
}
}
示例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));
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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');
}
示例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/');
}
示例15: setUp
protected function setUp()
{
parent::setUp();
$this->applicationFactory = ApplicationFactory::getInstance();
$store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->getMockForAbstractClass();
$this->applicationFactory->registerObject('Store', $store);
}