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


PHP test::random_movie方法代码示例

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


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

示例1: movie_thumbnails_are_jpgs_test

 public function movie_thumbnails_are_jpgs_test()
 {
     $movie = test::random_movie();
     $name = legal_file::change_extension($movie->name, "jpg");
     $_SERVER["REQUEST_URI"] = url::file("var/thumbs/{$name}");
     $controller = new File_Proxy_Controller();
     $this->assert_same($movie->thumb_path(), $controller->__call("", array()));
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:8,代码来源:File_Proxy_Controller_Test.php

示例2: get_file_metadata_test

 public function get_file_metadata_test()
 {
     $movie = test::random_movie();
     $this->assert_equal(array(360, 288, "video/x-flv", "flv", 6.0), movie::get_file_metadata($movie->file_path()));
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:5,代码来源:Movie_Helper_Test.php

示例3: find_by_path_with_album_test

 public function find_by_path_with_album_test()
 {
     $parent = test::random_album();
     $album = test::random_movie($parent);
     $album_path = "{$parent->name}/{$album->name}";
     $thumb_path = "{$album_path}/.album.jpg";
     // Check normal operation.
     $this->assert_equal($album->id, item::find_by_path($album_path, "albums")->id);
     $this->assert_equal($album->id, item::find_by_path($thumb_path, "thumbs")->id);
     $this->assert_equal($album->id, item::find_by_path($album_path)->id);
     // Check that we don't get false positives.
     $this->assert_equal(null, item::find_by_path($thumb_path, "albums")->id);
     $this->assert_equal(null, item::find_by_path($album_path, "thumbs")->id);
     $this->assert_equal(null, item::find_by_path($thumb_path)->id);
     // Check normal operation without relative path cache.
     self::_remove_relative_path_caches();
     $this->assert_equal($album->id, item::find_by_path($album_path, "albums")->id);
     self::_remove_relative_path_caches();
     $this->assert_equal($album->id, item::find_by_path($thumb_path, "thumbs")->id);
     self::_remove_relative_path_caches();
     $this->assert_equal($album->id, item::find_by_path($album_path)->id);
     // Check that we don't get false positives without relative path cache.
     self::_remove_relative_path_caches();
     $this->assert_equal(null, item::find_by_path($thumb_path, "albums")->id);
     $this->assert_equal(null, item::find_by_path($album_path, "thumbs")->id);
     $this->assert_equal(null, item::find_by_path($thumb_path)->id);
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:27,代码来源:Item_Helper_Test.php

示例4: generate_bad_movie_test

 public function generate_bad_movie_test()
 {
     // Unlike photos, its ok to have missing movies - no thrown exceptions, thumb_dirty can be reset.
     $movie = test::random_movie();
     // At this point, the movie is valid and has a valid thumb.  Make it garble.
     file_put_contents($movie->file_path(), test::lorem_ipsum(200));
     // Regenerate
     $movie->thumb_dirty = 1;
     graphics::generate($movie);
     // Check that the image got replaced with a missing image placeholder
     $this->assert_same(file_get_contents(MODPATH . "gallery/images/missing_movie.jpg"), file_get_contents($movie->thumb_path()));
     // Check that the items table got updated with new metadata
     $this->assert_equal(array(200, 200), array($movie->thumb_width, $movie->thumb_height));
     // Check that the image is *not* marked as dirty
     $this->assert_equal(0, $movie->thumb_dirty);
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:16,代码来源:Graphics_Helper_Test.php

示例5: fix_conflict_when_base_names_identical_between_jpg_png_flv_test

 public function fix_conflict_when_base_names_identical_between_jpg_png_flv_test()
 {
     $parent = test::random_album();
     $item1 = test::random_photo($parent);
     $item2 = test::random_photo($parent);
     $item3 = test::random_movie($parent);
     $item1_orig_base = pathinfo($item1->name, PATHINFO_FILENAME);
     $item2_orig_slug = $item2->slug;
     $item3_orig_slug = $item3->slug;
     $item2->set_data_file(MODPATH . "gallery/images/graphicsmagick.png");
     $item2->name = "{$item1_orig_base}.png";
     $item2->save();
     $item3->name = "{$item1_orig_base}.flv";
     $item3->save();
     // item2 and item3 have same base name as item1 - conflict resolved by renaming with -01 and -02.
     $this->assert_same("{$item1_orig_base}-01.png", $item2->name);
     $this->assert_same("{$item2_orig_slug}-01", $item2->slug);
     $this->assert_same("{$item1_orig_base}-02.flv", $item3->name);
     $this->assert_same("{$item3_orig_slug}-02", $item3->slug);
 }
开发者ID:HarriLu,项目名称:gallery3,代码行数:20,代码来源:Item_Model_Test.php


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