summaryrefslogtreecommitdiff
path: root/modules/gallery/tests
AgeCommit message (Collapse)Author
2013-06-26Fix Controller_Auth_Test - T_CURLY_OPEN not parsed as "{". Update golden file.shadlaws
--HG-- extra : source : 816294dd5f6fe23160baf9f516e49c66ea8fcb6c
2013-06-08Rename uploadify SWF wrappers to end in .swf.php for consistency.Bharat Mediratta
2013-05-09Get rid of the security preamble - we intend for these files to be directly ↵Bharat Mediratta
accessible.
2013-05-09Change upload code to use new uploadify urls.Bharat Mediratta
2013-04-14Golden file update follow-on for c37288f0b24c19813405096c087ab0c7c171c358Bharat Mediratta
2013-03-13Merge pull request #202 from shadlaws/fix_2051Bharat Mediratta
#2051 - Revise how Gallery_View returns combined JS and CSS.
2013-03-13#2059 - Add album name sanitizing similar to photo/movie filename sanitizing.shadlaws
- added legal_file::sanitize_dirname(), analogous to sanitize_filename. - revised item model to use new function when adding or updating an album. - added some legal_file unit tests. - revised some item model unit tests.
2013-03-12#2051 - Revise how Gallery_View returns combined JS and CSS.shadlaws
Changed Gallery_View's JS and CSS combining to: - have get_combined() combine all groups if called without arguments. - ensure the "core" group is combined first. - always put links where get_combined() is called, even if combining is disabled (otherwise the order isn't preserved). - add key as cache buster when combining is disabled. - make "LOOKING FOR YOUR CSS/JAVASCRIPT..." comments in get_combined(), not in the theme itself. Also, revised xss_data.txt golden file (line number changes only).
2013-03-12#2057 - Revise item name and slug validation - backslashes, refactor, error ↵shadlaws
messages. - disallowed backslashes in item validation. - refactored the validation logic in the item model a bit. - added no_backslash error messages in edit album/photo/movie forms. - fixed error messages in add album forum (some missing, some text different from edit) - added unit tests - updated to v58 to correct any existing backslashes in item names
2013-03-10#2048 - Remove unneeded jquery.autocomplete.css/js inclusions.shadlaws
- removed autocomplete.css/js calls in server_add, tag, and g2_import. - revised xss_data.txt golden file (line number changes only).
2013-03-09#2046 - Change Gallery over to using MediaElementJS as its movie player.shadlaws
2013-03-06Follow-on for #2043. Fix some tests that made bad assumptions aboutBharat Mediratta
the state of the world. These were uncovered when we ran the tests on Travis which runs the tests in a different order than what I (and apparently others) use on their dev boxes.
2013-03-05Follow-on to 384bc7afc86be706bf61def09afc8306cdad2443 for #2033Bharat Mediratta
Update golden file for XSS test.
2013-03-03Merge pull request #179 from shadlaws/fix_2034Bharat Mediratta
#2034 - Add webm and ogv as valid movie types.
2013-03-03Follow-on to #2033 - Rename movieplayer.html.php to movieplayer-flash.html.phpshadlaws
- renamed file with "-flash" to make room for html5 player - updated item model and xss_data.txt to reflect changes --HG-- rename : modules/gallery/views/movieplayer.html.php => modules/gallery/views/movieplayer-flash.html.php
2013-03-03#2034 - Add webm and ogv as valid movie types.shadlaws
- added them to legal_file helper - revised unit tests
2013-03-02#2031 - Add class_exists() before method_exists() if class existence is unknown.shadlaws
- fixed all instances of this in core code - deleted previous Zend Guard Loader workaround in MY_Kohana.php - updated Bootstrap.php to reflect deleted MY_Kohana.php
2013-02-26#2010 - Revise item::find_by_path to search for jpg-converted items.shadlaws
- added extra $var_subdir argument to item::find_by_path. - changed item::find_by_path to use $var_subdir to detect if we should look for a jpg-converted item or not (e.g. movie thumbs) - moved the album thumb detection to item::find_by_path to ensure it knows to look for an exact album match. - added more sanity checks to item::find_by_path (now has fewer false positive possibilities). - updated file_proxy to remove the need to guess different movie files. - updated File_Proxy_Controller - new sanity checks catch previously undetected bug. - added additional unit tests for item::find_by_path.
2013-02-25Follow-on from autocomplete and gallery.panel.js revisions.shadlaws
(9345dde83e1f092a9309c45282dc21e3fd408875, d632ef3e50252d388c272cacd29e8cc6e4949cec, fd012276cbf03cc1dc7b8da10aac5cc6f26326c6) - revised xss_data.txt golden file (no new cases). - escaped translated string in admin_users.html.php (would have otherwise been a new case in xss_data.txt).
2013-02-20#2008 - Add warnings if some active modules are obsolete.shadlaws
- added module::get_obsolete_modules_message function - put message on admin/dashboard - put message on admin/modules - put message on upgrader - updated unit test golden file xss_data
2013-02-18Fix up some tests:Bharat Mediratta
- unlink copied files because they confused File_Structure_Test - update golden files
2013-02-14#2003 - Add admin/movies screen.shadlaws
Added admin/movies screen analogous to the admin/graphics screen so the user can: - see how FFmpeg is configured (path and version, similar to toolkits in admin/graphics) - get some instructions on how to install FFmpeg if not found - change the movie_allow_uploads setting - ask Gallery to rebuild their movie thumbs Specifics: - admin_movies, admin_movies.html (new) - new Movies admin screen - ffmpeg.png (new) - logo for admin screen - movie::get_ffmpeg_version (new) - return version number and date of FFmpeg - form_uploadify.html - change admin message if movie uploads are disabled - gallery_event::admin_menu - added Movies link to Settings - xss_data.txt - updated golden file for unit tests
2013-02-12#2001 - Make filename sanitizing more consistent.shadlaws
- legal_file - added sanitize_filname() to sanitize photo/movie filenames. - admin_watermarks - revised add() to use new function. - item model - added _process_data_file_info() to validate the data file, get its metadata, and sanitize the item name. - item model - revised save() for new items to use _process_data_file_info *before* the slug is checked. - item model - revised save() for updated items to use _process_data_file_info. - item model - revised save() for updated items to sanitize name if changed. - uploader - removed call to smash_extensions (item model does this when it calls sanitize_filename). - Legal_File_Helper_Test - added unit tests for sanitize_filename. - Item_Model_Test - revised existing unit tests based on changes. - Item_Model_Test - added new unit tests for names with legal but incorrect extensions. - Averted take over by HAL with fix #2001...
2013-02-10#2000 - Make legal_file::smash_extensions more robust.shadlaws
- Fixed legal_file::smash_extensions. - Added new unit test. - Removed duplicated condition in existing unit test.
2013-02-08#1994 - Make get_file_metadata throw an exception if photo or movie is ↵shadlaws
unidentifiable/illegal. - photo & movie helpers: modified to throw exceptions when file is known to be unidentifiable/illegal. - item model: revised to work with exceptions and be more explicit when the data file is invalid. - item model: removed duplicate get_file_metadata call for updated items. - admin_watermarks controller: revised to work with exceptions (really cleans up logic here). - graphics helper: revised to handle invalid placeholders (a nearly-impossible corner case, but still...). - photo & movie helper tests: revised to work with exceptions, added new tests for illegal files with valid extensions. - item model tests: revised to work with exceptions, added new tests for illegal files with valid extensions.
2013-02-06Follow-on to 949b8cda14ec037386da34c43248ebd60542f5da for #1982.shadlaws
- Add extra condition to Item_Model_Test::urls_test to test cache busters of missing files. - Previous commit fixes unit test for empty album url, but now no test checks missing files.
2013-02-03Merge pull request #118 from shadlaws/fix_1982_followonBharat Mediratta
Follow-on to f83ed5f8716663a45c9d8e8118bbcf0e2849c3fb for #1982.
2013-02-02Follow-in to 314e2e67b1d52b7d01a715d7a6680862bf83b987 for #1986.shadlaws
- Update xss_test golden file (change line numbers).
2013-02-02Follow-on to f83ed5f8716663a45c9d8e8118bbcf0e2849c3fb for #1982.shadlaws
- Fix unit test for album url since empty albums now have thumbnails.
2013-01-31#1982 - Add placeholder for albums with no album cover.shadlaws
- Added missing_album_cover.jpg placeholder image. - Modified the graphics helper to use it. Calling graphics::generate will copy it. - Modified item::remove_album_cover and gallery_event::item_created to run graphics::generate. - Added unit test to Graphics_Helper_Test.
2013-01-30#1968 - Improve album cover generation/removal/etc.shadlaws
- Added stanza to Item_Model::save that handles when cover id is null. - Added logic to graphics::generate to copy/convert album cover thumbs from their item thumbs to ensure they're always jpg, and eliminate the possibility that we copy/convert a dirty thumb. - Redirected other places in code where we want to do one of the above two things to use these two functions instead (gallery_event::item_updated_data_file, item::make_album_cover, item::remove_album_cover). - Improved validation in Item_Model so only albums can have covers and all covers must be non-albums. - Added unit tests to Graphics_Helper_Test.
2013-01-29#1967 - Improve how graphics::generate handles missing/bad images.shadlaws
- Made missing_photo match the image format (jpg, png, etc.). - Swapped missing_photo.png for missing_photo.jpg since it's likely to require less conversion to match. - Improved error messages to user when things go wrong. - Ensured that missing image placeholders are always copied when there's an error. - Ensured we don't mistake no file output for a correct file output (delete target before attempt). - Restructured graphics::generate a bit to work better with above changes. - Added unit tests for graphics::generate.
2013-01-28#1945 - Extend legal_file helper functions.shadlaws
- Added get_types_by_extension function, which is a merged version of get...types_by_extension functions (similar to get_extensions). - Added optional extension argument to get...extensions functions similar to get...types_by_extension functions. - Added unit tests. Now, every legal_file function has one. - Restructured helper file to include caches. - Added array_unique to get...types (derived from get...types_by_extension, which can be many-to-one). - Edited server_add, uploader, and item model to use new functionality.
2013-01-28#1971 - Make resequence_child_weights_test unit test more reliable.shadlaws
- Set the sort_column of the parent album to id, which has no possibility of being identical between the two photos. - Now, the reweighting will reverse the order even if they were created during the same second.
2013-01-26#1946, 1947 - Make altered names/slugs more user-friendly, make ↵shadlaws
conflict-finding code check filenames with no extensions - Reduced from four places that alter names/slugs to two (one to populate empty slugs, one to handle conflicting names/slugs). - For empty slugs, fill with generic human-readable name (e.g. "photo") instead of random value. - For conflicting names/slugs, add suffix that's sequential (e.g. "-01"), only using random after 99 conflicts. - Made conflict-finding code check filenames with no extensions. - Renamed _randomize_name_or_slug_on_conflict to _check_and_fix_conflicts. - Added unit tests. Also cleaned up existing unit tests to reflect new logic and removed a redundant test. - Added installer logic to correct existing items now considered in conflict. - Revised gallery_task to look for duplicate names based on new criteria.
2013-01-25Merge pull request #103 from shadlaws/fix_1965Bharat Mediratta
#1965 - Improve sanity checks and copy/convert/process logic for rotate and resize
2013-01-26#1951 - Make metadata generation more flexible (photo and movie helpers).shadlaws
- added photo_get_file_metadata and movie_get_file_metadata events - modified photo::get_file_metadata and movie::get_file_metadata to use them - ensure that non-readable files throw exceptions - redirected other photo metadata calls in core to photo::get_file_metadata (the helper function already exists, but in many places getimagesize is still called directly) - added some unit tests (neither of the functions above had one)
2013-01-25#1965 - Improve sanity checks and copy/convert/process logic for rotate and ↵shadlaws
resize. - resize: ensured that resize is skipped *only* if the metadata is valid or the options are well-defined and would upscale. Then, if resize is skipped, check to see if it still needs to be converted. Previous conditions would allow a small PNG to get copied to a JPG, and would allow a corrupted JPG to be copied to the output. - rotate: add checks for empty file or empty options. - use get_file_metadata instead of direct getimagesize call. - add unit tests for rotate and resize, including some for corrupted input files and missing options.
2013-01-25#1956 - Escape LIKE queries (for _ and %).shadlaws
In MySQL queries, _ and % characters are treated as wildcards (similar to ? and *, respectively). - Added escape_for_like function to MY_Database.php - Added unit test to Database_Test - Corrected the five unescaped instances in the code using this function.
2013-01-24Merge pull request #99 from shadlaws/fix_1955Bharat Mediratta
#1955 - Make unit test photos unique.
2013-01-24#1955 - Make unit test photos unique.shadlaws
- Added test::random_unique_photo and test::random_unique_photo_unsaved to uniquify test photos. - Uniquified the black dot of test.jpg by coloring it with the six-digit hex code already used to name the random photos (e.g. "name_a48801.jpg"). - Modified four tests in Item_Model_Test that check photo file contents to use new functions to guarantee uniqueness.
2013-01-24#1960 - Add unit test to look for extra spaces at end of lineshadlaws
- Added no_extra_spaces_at_end_of_line_test to File_Structure_Test. - Updated Gallery_Filters to exclude testing code that isn't ours. - Removed existing extra spaces. New test now passes.
2013-01-23Extract reweighting logic out of Organize_Controller intoBharat Mediratta
item::reweight_all_children as an API and write a test for it. Work in progress on #1914.
2013-01-23Add a cache buster to all data_rest urls, add caching headers to allBharat Mediratta
data_rest responses, and check cache validity. Fixes #1909.
2013-01-23After finding a test in Item_Model_Test that didn't end in the string ↵Bharat Mediratta
"_test" and fixing it in 9ba9f3953132c5c5de9efb0a4724c7b9300dc9ea I decided to write a test to make sure that we don't have any other overlooked tests. We don't.
2013-01-23Fix comment typo.Bharat Mediratta
2013-01-23Update golden files after 80d6a895edb1cfc3dd0bcacd0d2c63b40c04670cBharat Mediratta
2013-01-23Add a "can_add" permission bit similar to the "can_edit" bit to the RESTful ↵Bharat Mediratta
array representation of Item_Model. Fixes #1903.
2013-01-21Update copyright to 2013. Fixes #1953.Bharat Mediratta
2013-01-20Merge pull request #95 from shadlaws/fix_1950Bharat Mediratta
#1950 - Replace bogus file overwrites from item model unit test.