コード例 #1
0
 public function tearDown()
 {
     foreach ($this->tearDownHandlers as $handler) {
         $handler();
     }
     parent::tearDown();
 }
コード例 #2
0
 public function tearDown()
 {
     if ($this->api) {
         $this->api->delete();
     }
     parent::tearDown();
 }
コード例 #3
0
 public function tearDown()
 {
     if (is_file(__DIR__ . '/Fixtures/configuration-maintenance.php')) {
         unlink(__DIR__ . '/Fixtures/configuration-maintenance.php');
     }
     parent::tearDown();
 }
コード例 #4
0
 public function tearDown()
 {
     $app = new Application(Application::ENV_TEST);
     \phrasea::reset_sbasDatas($app['phraseanet.appbox']);
     \phrasea::reset_baseDatas($app['phraseanet.appbox']);
     parent::tearDown();
 }
コード例 #5
0
ファイル: MetaFieldTest.php プロジェクト: nlegoff/Phraseanet
 /**
  * @covers Alchemy\Phrasea\Border\Attribute\MetaField::__destruct
  */
 public function tearDown()
 {
     \PHPUnit_Framework_Error_Warning::$enabled = $this->before;
     \PHPUnit_Framework_Error_Notice::$enabled = $this->beforeNotice;
     $this->object = null;
     parent::tearDown();
 }
コード例 #6
0
 public static function tearDownAfterClass()
 {
     $app = new Application('test');
     \phrasea::reset_sbasDatas($app['phraseanet.appbox']);
     \phrasea::reset_baseDatas($app['phraseanet.appbox']);
     parent::tearDownAfterClass();
 }
コード例 #7
0
 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;
 }
コード例 #8
0
ファイル: ReceiverTest.php プロジェクト: luisbrito/Phraseanet
 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);
 }
コード例 #9
0
ファイル: OAuth2Test.php プロジェクト: nlegoff/Phraseanet
 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);
 }
コード例 #10
0
ファイル: ElementTest.php プロジェクト: nlegoff/Phraseanet
 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');
 }
コード例 #11
0
 public function setUp()
 {
     parent::setUp();
     if (!function_exists('xcache_info')) {
         $this->markTestSkipped('Xcache not loaded');
     }
     $this->object = new XcacheCache();
 }
コード例 #12
0
 public static function tearDownAfterClass()
 {
     if (self::$object instanceof \collection) {
         self::$object->delete();
     }
     self::$object = self::$objectDisable = null;
     parent::tearDownAfterClass();
 }
コード例 #13
0
 public function tearDown()
 {
     $this->media = null;
     if (file_exists($this->filename)) {
         unlink($this->filename);
     }
     parent::tearDown();
 }
コード例 #14
0
ファイル: TermTest.php プロジェクト: nlegoff/Phraseanet
 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);
 }
コード例 #15
0
 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);
 }
コード例 #16
0
 public function tearDown()
 {
     $finder = new Finder();
     $finder->files()->in($this->root);
     foreach ($finder as $file) {
         unlink($file->getRealPath());
     }
     parent::tearDown();
 }
コード例 #17
0
 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);
 }
コード例 #18
0
 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();
 }
コード例 #19
0
 public static function tearDownAfterClass()
 {
     if (null !== self::$userSettings) {
         self::$DI['app']['conf']->set('user-settings', self::$userSettings);
     }
     if (null !== self::$appSettings) {
         self::$DI['app']['conf']->set('registry', self::$appSettings);
     }
     self::$userSettings = self::$appSettings = null;
     parent::tearDownAfterClass();
 }
コード例 #20
0
ファイル: ApcCacheTest.php プロジェクト: luisbrito/Phraseanet
 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();
 }
コード例 #21
0
 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");
 }
コード例 #22
0
ファイル: ApiTest.php プロジェクト: luisbrito/Phraseanet
 public function tearDown()
 {
     if ($this->object) {
         $this->object->delete();
     }
     try {
         new Bridge_Api(self::$DI['app'], $this->id);
         $this->fail();
     } catch (Bridge_Exception_ApiNotFound $e) {
     }
     parent::tearDown();
 }
コード例 #23
0
 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);
 }
コード例 #24
0
 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);
 }
コード例 #25
0
ファイル: AccountTest.php プロジェクト: luisbrito/Phraseanet
 public static function tearDownAfterClass()
 {
     if (self::$object) {
         self::$object->delete();
         self::$object = null;
     }
     if (self::$api) {
         self::$api->delete();
         self::$api = null;
     }
     self::$object = self::$api = self::$dist_id = self::$named = self::$id = null;
     parent::tearDownAfterClass();
 }
コード例 #26
0
ファイル: fieldTest.php プロジェクト: luisbrito/Phraseanet
 public function tearDown()
 {
     if ($this->object_mono instanceof databox_field) {
         $this->object_mono->delete();
     }
     if ($this->object_multi instanceof databox_field) {
         $this->object_multi->delete();
     }
     $extra = $this->databox->get_meta_structure()->get_element_by_name('Bonoboyoyo');
     if ($extra instanceof databox_field) {
         $extra->delete();
     }
     parent::tearDown();
 }
コード例 #27
0
ファイル: ElementTest.php プロジェクト: luisbrito/Phraseanet
 public function tearDown()
 {
     if ($this->object) {
         $this->object->delete();
     }
     try {
         new Bridge_Element(self::$DI['app'], $this->account, $this->id);
         $this->fail();
     } catch (Bridge_Exception_ElementNotFound $e) {
     }
     if ($this->api) {
         $this->api->delete();
     }
     parent::tearDown();
 }
コード例 #28
0
ファイル: ContainerTest.php プロジェクト: nlegoff/Phraseanet
 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');
 }
コード例 #29
0
ファイル: ElementTest.php プロジェクト: luisbrito/Phraseanet
 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);
 }
コード例 #30
0
 public function setUp()
 {
     parent::setUp();
     $this->object = new TagProvider();
 }