public function setUp() { parent::setUp(); $this->name = 'name-' . mt_rand(); $this->email = sprintf('name-%s@domain-%s.com', mt_rand(), mt_rand()); $this->object = new Receiver($this->name, $this->email); }
public function setUp() { parent::setUp(); $this->file = __DIR__ . '/tmp-file.php'; $this->compiler = new Compiler(); $this->clean(); }
public function setUp() { parent::setUp(); $this->object = new Bridge_Api_Auth_OAuth2(); $this->parameters = ['client_id' => "client_id", 'client_secret' => "client_secret", 'redirect_uri' => "redirect_uri", 'scope' => 'super_scope', 'response_type' => 'code', 'token_endpoint' => "one_token_endpoint", 'auth_endpoint' => "one_auth_endpoint"]; $this->mockSettings = $this->getMock("Bridge_AccountSettings", ["get", "set"], [], "", false); }
public function setUp() { parent::setUp(); $published = new Zend_Gdata_App_Extension_Published("2011-10-21 12:00:00"); $updated = new Zend_Gdata_App_Extension_Updated("2011-10-21 12:20:00"); $id = new Zend_Gdata_App_Extension_Id("Az2cv12"); $rating = new Zend_Gdata_Extension_Rating(4, 1, 5, 200, 4); $duration = new Zend_Gdata_YouTube_Extension_Duration(80); $player = new Zend_Gdata_Media_Extension_MediaPlayer(); $player->setUrl("coucou"); $stat = new Zend_Gdata_YouTube_Extension_Statistics(); $stat->setViewCount("5"); $thumb = new Zend_Gdata_Media_Extension_MediaThumbnail('une url', '120', '90'); $media = new Zend_Gdata_YouTube_Extension_MediaGroup(); $media->setPlayer([$player]); $media->setDuration($duration); $media->setVideoId($id); $media->setThumbnail([$thumb]); $entry = new Zend_Gdata_YouTube_VideoEntry(); $entry->setMajorProtocolVersion(2); $entry->setMediaGroup($media); $entry->setStatistics($stat); $entry->setRating($rating); $entry->setVideoCategory("category"); $entry->setVideoDescription("one description"); $entry->setVideoPrivate(); $entry->setVideoTags(['tags']); $entry->setVideoTitle("hellow"); $entry->setUpdated($updated); $entry->setPublished($published); $this->object = new Bridge_Api_Youtube_Element($entry, 'video'); }
public function setUp() { parent::setUp(); $mock = $this->getMockBuilder('Alchemy\\Phrasea\\Authentication\\Authenticator')->disableOriginalConstructor()->setMethods(array('getUser'))->getMock(); $mock->expects($this->any())->method('getUser')->will($this->returnValue(self::$DI['user'])); self::$DI['app']['authentication'] = $mock; }
/** * @covers Alchemy\Phrasea\Border\File::__construct */ public function setUp() { parent::setUp(); $this->filename = __DIR__ . '/../../../../../tmp/iphone_pic.jpg'; copy(__DIR__ . '/../../../../files/iphone_pic.jpg', $this->filename); $this->media = self::$DI['app']['mediavorus']->guess($this->filename); $this->object = new File(self::$DI['app'], $this->media, self::$DI['collection'], 'originalName.txt'); }
public function setUp() { parent::setUp(); $this->control = new UserProvider(self::$DI['app']); $this->object = new Term($this->value, $this->context); $this->basicObject = new Term($this->basicValue); $this->objectWithControl = new Term($this->value2, $this->context2, $this->control, $this->id); }
public function setUp() { parent::setUp(); $this->account = API_OAuth2_Account::load_with_user(self::$DI['app'], self::$DI['oauth2-app-user'], self::$DI['user']); $expires = time() + 100; $this->code = random::generatePassword(8); $this->object = API_OAuth2_AuthCode::create(self::$DI['app'], $this->account, $this->code, $expires); }
/** * @covers Alchemy\Phrasea\Border\Attribute\Attribute * @covers Alchemy\Phrasea\Border\Attribute\Metadata::__construct */ public function setUp() { parent::setUp(); $tag = new ObjectName(); $value = new Mono('Stockhausen !'); $this->metadata = new ExiftoolMeta($tag, $value); $this->object = new Metadata($this->metadata); }
public function setUp() { parent::setUp(); if (!function_exists('xcache_info')) { $this->markTestSkipped('Xcache not loaded'); } $this->object = new XcacheCache(); }
public function setUp() { parent::setUp(); $this->root = __DIR__ . '/root'; if (!is_dir($this->root)) { mkdir($this->root); } }
public function setUp() { parent::setUp(); $this->object = new Sha256(self::$DI['app']); $this->filename = __DIR__ . '/../../../../../../tmp/test001.jpg'; copy(__DIR__ . '/../../../../../files/test001.jpg', $this->filename); $this->media = self::$DI['app']['mediavorus']->guess($this->filename); }
public function setUp() { parent::setUp(); $this->account = API_OAuth2_Account::load_with_user(self::$DI['app'], self::$DI['oauth2-app-user'], self::$DI['user']); $expires = time() + 100; $this->token = random::generatePassword(8); $this->scope = 'scopidou'; $this->object = API_OAuth2_RefreshToken::create(self::$DI['app'], $this->account, $expires, $this->token, $this->scope); }
/** * @covers Alchemy\Phrasea\Border\Checker\CheckerInterface * @covers Alchemy\Phrasea\Border\Checker\Filename::__construct */ public function setUp() { parent::setUp(); // initialize record so that it already exist $record = self::$DI['record_1']; $this->object = new Filename(self::$DI['app']); $this->filename = __DIR__ . '/../../../../../../tmp/test001.jpg'; copy(__DIR__ . '/../../../../../files/test001.jpg', $this->filename); $this->media = self::$DI['app']['mediavorus']->guess($this->filename); }
public function setUp() { parent::setUp(); $_SERVER['SERVER_SOFTWARE'] = 'apache'; $this->objects['apache'] = new system_server(); $_SERVER['SERVER_SOFTWARE'] = 'nginx'; $this->objects['nginx'] = new system_server(); $_SERVER['SERVER_SOFTWARE'] = 'lighttpd'; $this->objects['lighttpd'] = new system_server(); }
public function setUp() { parent::setUp(); if (null === self::$userSettings) { self::$userSettings = self::$DI['app']['conf']->get(['user-settings'], []); } if (null === self::$appSettings) { self::$appSettings = self::$DI['app']['conf']->get(['registry'], []); } }
public function setUp() { parent::setUp(); if (!extension_loaded('apc')) { $this->markTestSkipped('Apc is not installed'); } if (!ini_get('apc.enable_cli')) { $this->markTestSkipped('Apc is not loaded in CLI'); } $this->object = new ApcCache(); }
public function setUp() { parent::setUp(); $account = API_OAuth2_Account::load_with_user(self::$DI['app'], self::$DI['oauth2-app-user'], self::$DI['user']); try { new API_OAuth2_Token(self::$DI['app']['phraseanet.appbox'], $account); $this->fail(); } catch (Exception $e) { } $this->object = API_OAuth2_Token::create(self::$DI['app']['phraseanet.appbox'], $account); }
public function setUp() { parent::setUp(); $string = ' <photoset id="72157626216528324" primary="5504567858" secret="017804c585" server="5174" farm="6" photos="22" videos="0" count_views="137" count_comments="0" can_comment="1" date_create="1299514498" date_update="1300335009"> <title>Avis Blanche</title> <description>My Grandma\'s Recipe File.</description> </photoset> '; $xml = simplexml_load_string($string); $this->object = new Bridge_Api_Flickr_Container($xml, 'userid123', "photoset", "my_humbnail"); }
public function setUp() { parent::setUp(); $sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"'; $stmt = self::$DI['app']->getApplicationBox()->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); $this->type = 'Apitest'; $api = Bridge_Api::create(self::$DI['app'], $this->type); $this->id = $api->get_id(); $this->object = new Bridge_Api(self::$DI['app'], $api->get_id()); }
public function setUp() { parent::setUp(); $this->object = new MemcachedCache(); if (!class_exists('Memcached')) { $this->markTestSkipped('No memcached extension'); } $memcached = new \Memcached(); if (!@$memcached->addServer('localhost', 11211)) { $this->markTestSkipped('No memcached server'); } $this->object->setMemcached($memcached); }
public function setUp() { parent::setUp(); $this->object = new MemcacheCache(); if (!class_exists('Memcache')) { $this->markTestSkipped('No memcache extension'); } $memcache = new \Memcache(); if (!@$memcache->connect('localhost', 11211)) { $this->markTestSkipped('No memcache server'); } $this->object->setMemcache($memcache); }
/** * @covers Alchemy\Phrasea\Border\Attribute\MetaField::__construct */ public function setUp() { parent::setUp(); $this->value = ["Un éléphant ça trompe"]; foreach (self::$DI['collection']->get_databox()->get_meta_structure() as $databox_field) { $this->databox_field = $databox_field; break; } if (!$this->databox_field) { $this->markTestSkipped('No databox field found'); } $this->object = new MetaField($this->databox_field, $this->value); $this->before = \PHPUnit_Framework_Error_Warning::$enabled; $this->beforeNotice = \PHPUnit_Framework_Error_Notice::$enabled; }
public function setUp() { parent::setUp(); $this->databox = self::$DI['record_1']->get_databox(); $this->name_mono = 'Field Test Mono'; $this->name_multi = 'Field Test Multi'; $this->object_mono = $this->databox->get_meta_structure()->get_element_by_name($this->name_mono); $this->object_multi = $this->databox->get_meta_structure()->get_element_by_name($this->name_multi); if (!$this->object_mono instanceof databox_field) { $this->object_mono = databox_field::create(self::$DI['app'], $this->databox, $this->name_mono, false); } if (!$this->object_multi instanceof databox_field) { $this->object_multi = databox_field::create(self::$DI['app'], $this->databox, $this->name_multi, true); } }
public function setUp() { parent::setUp(); $published = new Zend_Gdata_App_Extension_Published("2011-10-21 12:00:00"); $updated = new Zend_Gdata_App_Extension_Updated("2011-10-21 12:20:00"); $id = new Zend_Gdata_App_Extension_Id("Az2cv12"); $entry = new Zend_Gdata_YouTube_PlaylistListEntry(); $entry->setMajorProtocolVersion(2); $entry->setId($id); $entry->setTitle(new Zend_Gdata_App_Extension_Title("one title")); $entry->setUpdated($updated); $entry->setPublished($published); $entry->setLink([new Zend_Gdata_App_Extension_link("one url", "alternate")]); $entry->setDescription(new Zend_Gdata_App_Extension_Summary("one description")); $this->object = new Bridge_Api_Youtube_Container($entry, 'playlist', 'my_thumbnail'); }
public function setUp() { parent::setUp(); try { $sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"'; $stmt = self::$DI['app']->getApplicationBox()->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); $this->api = Bridge_Api::create(self::$DI['app'], 'Apitest'); $this->dist_id = 'EZ1565loPP'; $this->named = 'Fête à pinpins'; $this->account = Bridge_Account::create(self::$DI['app'], $this->api, self::$DI['user'], $this->dist_id, $this->named); $this->object = new Bridge_AccountSettings(self::$DI['app']['phraseanet.appbox'], $this->account); } catch (Exception $e) { $this->fail($e->getMessage()); } }
public function setUp() { parent::setUp(); $sql = 'DELETE FROM bridge_apis WHERE name = "Apitest"'; $stmt = self::$DI['app']->getApplicationBox()->get_connection()->prepare($sql); $stmt->execute(); $stmt->closeCursor(); $this->api = Bridge_Api::create(self::$DI['app'], 'Apitest'); $this->dist_id = 'EZ1565loPP'; $this->named = 'Fête à pinpins'; $this->account = Bridge_Account::create(self::$DI['app'], $this->api, self::$DI['user'], $this->dist_id, $this->named); $this->title = 'GOGACKO'; $this->status = 'Processing'; $element = Bridge_Element::create(self::$DI['app'], $this->account, self::$DI['record_1'], $this->title, $this->status, $this->account->get_api()->get_connector()->get_default_element_type()); $this->id = $element->get_id(); $this->object = new Bridge_Element(self::$DI['app'], $this->account, $this->id); }
public function setUp() { parent::setUp(); if (null === self::$recordonbleu) { $file = new File(self::$DI['app'], self::$DI['app']['mediavorus']->guess(__DIR__ . "/../../files/iphone_pic.jpg"), self::$DI['collection']); self::$recordonbleu = record_adapter::createFromFile($file, self::$DI['app']); self::$DI['app']['subdef.generator']->generateSubdefs(self::$recordonbleu); foreach (self::$recordonbleu->get_subdefs() as $subdef) { if ($subdef->get_name() == 'document') { continue; } if (!self::$objectPresent) { self::$objectPresent = $subdef; continue; } if (!self::$objectNotPresent) { self::$objectNotPresent = $subdef; continue; } } self::$objectNotPresent->remove_file(); } }
public function setUp() { parent::setUp(); $str = ' <photo id="6263188755" width_t="100" height_t="67" url_t="http://farm7.static.flickr.com/6034/6263188755_2dca715798_t.jpg" width_sq="75" height_sq="75" url_sq="http://farm7.static.flickr.com/6034/6263188755_2dca715798_s.jpg" views="1" tags="" lastupdate="1319126343" ownername="Boontyp4" datetakengranularity="0" datetaken="2008-09-28 20:26:00" dateupload="1319117962" license="0" isfamily="0" isfriend="0" ispublic="1" title="un titre" farm="7" server="6034" secret="2dca715798" owner="60578095@N05"> <description>une description</description> </photo> '; $string = ' <rsp stat="ok"> <photo id="5930279108" media="photo" views="1" rotation="0" safety_level="0" license="0" isfavorite="0" dateuploaded="1310477820" farm="7" server="6135" secret="c06196fbd8"> <owner iconfarm="0" iconserver="0" location="" realname="" username="******" nsid="60578095@N05"></owner> <title>Australia.gif</title> <description>drapeau de l\'australie</description> <visibility isfamily="0" isfriend="1" ispublic="0"></visibility> <dates lastupdate="1314975347" takengranularity="0" taken="2011-07-12 06:37:00" posted="1310477820"></dates> <permissions permaddmeta="2" permcomment="3"></permissions> <editability canaddmeta="1" cancomment="1"></editability> <publiceditability canaddmeta="0" cancomment="1"></publiceditability> <usage canshare="0" canprint="1" canblog="1" candownload="1"></usage> <comments>0</comments> <notes></notes> <people haspeople="0"></people> <tags> <tag>yo</tag> </tags> <urls> <url type="photopage">http://www.flickr.com/photos/bees/2733/</url> </urls> </photo> </rsp> '; $this->xml_alone = simplexml_load_string($string); $this->object_alone = new Bridge_Api_Flickr_Element($this->xml_alone, '12037949754@N01', 'album', false); $this->xml_list = simplexml_load_string($str); $this->object_list = new Bridge_Api_Flickr_Element($this->xml_list, '12037949754@N01', 'album', true); }
public function setUp() { parent::setUp(); $this->object = new TagProvider(); }