Commit Graph

410 Commits

Author SHA1 Message Date
Bharat Mediratta
6830ac4542 Merge pull request #99 from shadlaws/fix_1955
#1955 - Make unit test photos unique.
2013-01-24 12:46:26 -08:00
shadlaws
126727b4f2 #1955 - Make unit test photos unique.
- 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 15:56:13 +01:00
shadlaws
031dd3bd6f #1960 - Add unit test to look for extra spaces at end of line
- 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-24 12:03:05 +01:00
Bharat Mediratta
aa8fffcd8f Extract reweighting logic out of Organize_Controller into
item::reweight_all_children as an API and write a test for it.  Work
in progress on #1914.
2013-01-23 21:33:19 -05:00
Bharat Mediratta
34198e71d3 Add a cache buster to all data_rest urls, add caching headers to all
data_rest responses, and check cache validity.  Fixes #1909.
2013-01-23 20:50:54 -05:00
Bharat Mediratta
cc926cb9e1 After finding a test in Item_Model_Test that didn't end in the string "_test" and
fixing it in 9ba9f39531 I decided to write a test to make
sure that we don't have any other overlooked tests.  We don't.
2013-01-23 18:58:37 -05:00
Bharat Mediratta
bc5dbd812a Fix comment typo. 2013-01-23 18:56:30 -05:00
Bharat Mediratta
e6783b7aa7 Update golden files after 80d6a895ed 2013-01-23 18:28:28 -05:00
Bharat Mediratta
9ba9f39531 Add a "can_add" permission bit similar to the "can_edit" bit to the RESTful array
representation of Item_Model.  Fixes #1903.
2013-01-23 18:24:31 -05:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
61eebe13c9 Merge pull request #95 from shadlaws/fix_1950
#1950 - Replace bogus file overwrites from item model unit test.
2013-01-20 22:06:12 -08:00
Bharat Mediratta
8dc34dade8 Add unit tests for data_rest. While I'm in there, get rid of the
clause that returns nothing when the album has no album cover - we'll
fail before that if the album's thumbnail is missing, and if it's not
missing then we'll have something to serve even if it's out of date.
2013-01-21 00:52:52 -05:00
Bharat Mediratta
f1d2a8e871 Add a long overdue test for File_Proxy_Controller that tests all the various
edge case behaviors.  It doesn't cover the various headers, but it does cover
the permission based code paths.
2013-01-20 23:54:01 -05:00
shadlaws
14b02a5b12 #1950 - Replace bogus file overwrites from item model unit test.
- modified rename_photo_test, rename_album_test, move_album_test, move_photo_test
- unit tests still test file system integrity and pass
2013-01-20 10:01:41 +01:00
Bharat Mediratta
f215a417f1 Merge pull request #88 from shadlaws/fix_1941
#1941, 1948 - Fix possible warnings in movie and graphics helpers, add functions to convert between seconds and hh:mm:ss.dd (and their unit tests).
2013-01-19 21:41:45 -08:00
Bharat Mediratta
a06abe32b0 Simplify get_photo_types_by_extension_test and get_movie_types_by_extension_test. 2013-01-20 00:39:58 -05:00
Bharat Mediratta
35bb5c4a1c Merge pull request #93 from shadlaws/fix_1944
#1944 - Fix possible warnings in legal_file::get_photo_types_by_extension and legal_file::get_movie_types_by_extension.
2013-01-19 21:34:39 -08:00
Bharat Mediratta
3a71813f35 Change the logic for finding controllers to use glob() but drop anything
that we can find is git-ignore'd.
2013-01-20 00:24:08 -05:00
shadlaws
ea8219e1d4 #1941, 1948 - Fix possible warnings in movie and graphics helpers, add functions to convert between seconds and hh:mm:ss.dd.
Also add unit tests for new movie helper functions.
2013-01-19 00:59:55 +01:00
shadlaws
e2a2a5ce81 #1944 - Fix possible warnings in legal_file::get_photo_types_by_extension and legal_file::get_movie_types_by_extension.
Added unit tests for these two functions, too.
2013-01-19 00:52:13 +01:00
shadlaws
3a9009492e #1943 - Make legal_file::change_extension more robust.
Previously would fail with dots in the directory but no extension.  Added unit tests to verify the new change works.
2013-01-18 20:06:05 +01:00
Bharat Mediratta
61724f78da Update golden files. 2013-01-17 15:22:50 -05:00
Bharat Mediratta
d04080c7be Follow-on to 94b26e506c - make the new legal_file
functions more robust when passed an unknown extension.  Fixes Item_Model_Test.
2013-01-17 15:05:46 -05:00
Bharat Mediratta
6d9d6a2e5d Allow albums to have two (or more) dots in the name. Fixes #1897. 2012-07-21 15:01:31 -07:00
Bharat Mediratta
8e74750dc2 Checkpoint XSS golden file 2012-06-11 13:54:33 -07:00
Bharat Mediratta
37a0e9a710 Follow-on to 3caf3cc323 for #1866 - harden one
more place and update the test.
2012-06-11 13:47:00 -07:00
Bharat Mediratta
9e2ea2ffed Smash multiple extensions down into a single one when accepting file
uploads.  Fixes #1872.
2012-05-17 20:25:27 -07:00
Bharat Mediratta
ffbaa7bf82 Follow on for #1845 - handle paths with dots in them properly. 2012-05-13 21:09:59 -07:00
Bharat Mediratta
ef4dbd18af Fix extension-swapping code for files that have extensions that are
not 3 characters long.  Fixes #1845.
2012-05-05 19:34:01 -07:00
Bharat Mediratta
801c9a98e4 Fix #1846. 2012-05-05 18:52:44 -07:00
Bharat Mediratta
daea22c6b3 Exclude modules/gallery/vendor/joomla from some structure tests 2012-04-01 14:07:50 -07:00
Bharat Mediratta
7ba0b1b75c Restrict valid urls to having a http:// or https:// prefix. Fixes #1830. 2012-04-01 11:36:16 -07:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
6d530991f2 Updated for #1764 and #1790 2012-02-27 09:19:43 -08:00
Bharat Mediratta
da523de777 Simplification of 59b04b897b for #1764:
- Breadcrumb::build_from_item becomes Breadcrumb::array_from_item_parents
- Eliminate Breadcrumb::$id -- it's no longer necessary
- Fold Breadcrumb::generate_show_query_strings into Breadcrumb::array_from_item_parents
- Create Breadcrumb::set_first() and Breadcrumb::set_last()
- Breadcrumb::build_from_list goes away, we just use arrays for this
- Change Search_Controller and Tag_Controller to just create an array
  of Breadcrumb instances with the first/last marked appropriately
- Breadcrumb_Test loses a bunch of complexity.
2011-08-08 21:29:19 -07:00
Tim Almdal
dd0b622ae9 Initial commit of a patch for Ticket #1764. as discussed here: https://github.com/gallery/gallery3/pull/58/files#r72949.
Create a Breadcrumb library which has two static methods for_item (which takes a an item and builds the entire
breadcrumb for the item) or build (which takes a variable number of Breadcrumb elements and creates a breadcrumb
based on the specified elements).

Used tag->url() to build the tag album url. Escaped the query string for the search. Tightened up the breadcrumb code
 in page.html.php.

When adding the show query parameter, we can't blindly concatenate using the ? separator.  We have to check that we
use a & if a query parameter already exists.
2011-08-07 13:41:47 -07:00
Bharat Mediratta
ce0b9bcc14 Update golden file. 2011-07-24 08:32:14 -07:00
Chad Parry
0672c8f83f Polishing the rawphoto changes, including adding some tests.
Squashed commit of the following:

commit 945316a8c220b12adb687c896bcc5e86f99f46a4
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 01:11:13 2011 -0600

    Add a test for the sunny-day scenario where a rule changes a data file's MIME type.

commit 4ee1ee000c8f4d8ebaae66f637bc71080486fd73
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:49:47 2011 -0600

    Ensure that a third-party cannot swap out a legitimate photo with an unsafe file type.

commit 7dd0105bfc59c150e5640e693778f51bbaa44eab
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:48:19 2011 -0600

    Update the MIME type and other meta-data when a new data file is provided.

commit 5a8844c7947b21cf658f22cc61f20ffa9e8f07f2
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:30:01 2011 -0600

    Remove a unit test that no longer applies. Replacement data files are allowed to have different MIME types.

commit 0de9c6283ce4f5773cad8e92b6785d6a1f7b5e46
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:27:45 2011 -0600

    If one rule fails, then abort processing, rather than trying to proceed to subsequent rules.

commit 41d379c2b777ae7b3a11f528971228e234f8976f
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:10:10 2011 -0600

    Replace an overly-complicated regular expression with a simple in_array, at Bharat's suggestion.

commit 1b3f7111d4c2607baaa2da0aab3b501f2d9a1426
Merge: 8f7904a 403f64b
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Jul 20 21:02:56 2011 -0600

    Merge branch 'master' into rawphoto

commit 8f7904ab62c71a7e4ee68762f936030b4dcb4ea1
Merge: e950573 771de0a
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Jun 25 14:12:39 2011 -0600

    Merge branches 'master' and 'rawphoto' into rawphoto

commit e95057337996351e49915d9f85d007d50103a4be
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Jun 15 20:24:18 2011 -0600

    Merge branches 'rawphoto-squash' and 'rawphoto' into rawphoto
2011-07-21 01:12:26 -06:00
Bharat Mediratta
46666837f3 Checkpoint 2011-05-24 20:33:36 -07:00
Bharat Mediratta
c71bb54185 Reassign the copyright to the standard custodian (Bharat). #1732. 2011-05-24 20:32:43 -07:00
Chad Parry
d2331bf434 Simplified the temp_filename implementation and removed the mocks. 2011-05-04 17:48:25 -06:00
Chad Parry
0e844766ba Change the signature of system::tempnam to something more appropriate for Gallery. 2011-04-30 17:45:44 -06:00
Chad Parry
5c9a3b3f39 Create a tempnam substitute that safely creates files with a given extension. 2011-04-30 17:45:44 -06:00
Bharat Mediratta
cbd04e1ae0 Move random::string() to be test::random_string() and have it return a
random string of any length.  Also introduce test::lorem_ipsum() and
use that in places where we want strings of words.  Fixes #1713.
2011-04-25 23:26:43 -07:00
Bharat Mediratta
11af2bc93f Update test golden files. 2011-04-25 22:07:56 -07:00
Bharat Mediratta
ce2c6c3ada Add convert_to_human_readable and tests for both. Resolves #1693. 2011-04-23 10:06:17 -07:00
Bharat Mediratta
526859d960 Do simple transliteration when converting filenames to slugs, but check
to see if the transliteration module is available and use a more complex
transliteration if possible.  Fixes #1668.
2011-04-22 13:57:46 -07:00
Bharat Mediratta
bc49680938 Update XSS golden file 2011-01-21 23:09:27 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
44da46abd4 Golden file updates for xss and controller authentication. 2011-01-15 15:11:37 -08:00