Commit Graph

295 Commits

Author SHA1 Message Date
Ingo Schommer
eec37c2694 BUGFIX Using mock controller in RestfulServiceTest to avoid problems with missing require() calls for PHPUnit/Framework.php (performed in recently merged PHPUnitWrapper::init() which is never called for "nested" true HTTP calls within unit tests). Mostly merged from branches/2.4.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@111837 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
bdd30fa4fd API CHANGE Don't reflect changes in File and Folder property setters on filesystem before write() is called, to ensure that validate() applies in all cases. This fixes a problem where File->setName() would circumvent restrictions in File::$allowed_extensions (fixes #5693)
API CHANGE Removed File->resetFilename(), use File->updateFilesystem() to update the filesystem, and File->getRelativePath() to just update the "Filename" property without any filesystem changes (emulating the old $renamePhysicalFile method argument in resetFilename())
API CHANGE Removed File->autosetFilename(), please set the "Filename" property via File->getRelativePath()
MINOR Added unit tests to FileTest and FolderTest (some of them copied from FileTest, to test Folder behaviour separately)
ENHANCEMENT Added File::$allowed_extensions (backport from 2.4 to enable File->validate() security fix)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@108062 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:36 +13:00
Ingo Schommer
0b79e85cc8 MINOR: Fixed FileTest execution if the assets/ directory doesn't exist. (from r88353) (from r98086)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@103521 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
add3165333 MINOR Fixed HTTPTest->testSetGetVar() (merged from r98409)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98410 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
5b8161012c MINOR Fixed HTTPTest->testSetGetVar() (merged from r98407)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98408 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
8698e94ae0 MINOR Added test case for Hierarchy::getDescendantIDList() which also tests Hierarchy::loadDescendantIDListInto() (merged from r98369)
MINOR Testing of grand-children items in HierarchyTest::testLoadDescendantIDListIntoArray() and HierarchyTest::testNumChildren() (merged from r98376)
BUGFIX #5044 Hierarchy::loadDescendantIDListInto() now uses Object::getExtensionInstance('Hierarchy') instead of going through call(), as PHP 5.3 has issues converting references to values
BUGFIX Fixed Hierarchy->loadDescendantIdList() to call setOwner() on the extension instance. This was necessary due to underlying Object/Extension changes in 2.4. (merged from r98403)
MINOR Fixed HierarchyTest assertions around including grand children counts (merged from r98403)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98405 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
58dc696497 MINOR Fixed HTTPTest when invoked through dev/tests/all or with GET parameters (see r98373) (merged from r98383)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98384 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Ingo Schommer
b3931cc707 API CHANGE HTTP::setGetVar() always returns absolute URLs. Use Director::makeRelative() to make them relative again. (merged from r98373)
API CHANGE HTTP::setGetVar() combines any GET parameters in PHP array notation (e.g. "foo[bar]=val") instead of replacing the whole array (merged from r98373)
BUGFIX HTTP::setGetVar() uses parse_url() and http_build_query() to add query parameters to an existing URL, instead of doing its own regex-based parsing. This means existing GET parameters are correctly url encoded. (merged from r98373)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@98375 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:35 +13:00
Sam Minnee
727f930e31 BUGFIX: Made use of new BasicAuth::protect_entire_site() consistent. (from r91658)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@91660 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:34 +13:00
Sam Minnee
98dda12a9d API CHANGE: Added increase_time_limit_to(), which respects safe_mode.
API CHANGE: Added no-arg option to increase_memory_limit_to() (from r80241)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@88176 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:33 +13:00
Sam Minnee
427cce498d API CHANGE: Make Object::uninherited_static() have a separate execution path to Object::get_static(), for more reliable operation. The intention is that for any given static, you either use Object::get_static() or you use Object::uninherited_static() - not both. (from r84151, r84155, r84156)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@84157 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Sean Harvey
bd28434884 MINOR Merged in DataObjectDecorator tests from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@83720 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:32 +13:00
Sean Harvey
512311d295 MINOR Fixed broken test in TextTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@82036 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:31 +13:00
Sean Harvey
5ffd79cb79 BUGFIX Fixed double up of <span> highlight tags around keywords in Text::ContextSummary()
MINOR Added test for Text::ContextSummary()



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@82035 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:31 +13:00
Sam Minnee
6394679b29 BUGFIX #4285: Fixed static application bug that appeared in 2.3.2
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@81698 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:30 +13:00
Will Rossiter
bfce550b30 ENHANCEMENT: simpleXML() now catches the error if you try to call it on anything other then xml. MINOR: added test to RESTFul Service
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@80340 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:29 +13:00
Ingo Schommer
3edc596bdb MINOR Merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@79282 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:29 +13:00
Ingo Schommer
059d05bae4 MINOR Merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@79211 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:29 +13:00
Sam Minnee
dedff46bf3 BUGFIX #4119: Fixed encoding of readonly TextareaFields and unicode in TextareaFields.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@78732 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:29 +13:00
Hamish Friedlander
98a75735ee MINOR: Tests for previous HTMLText#Summary and HTMLText#FirstSentence patch
BUGFIX: A couple of bugfixes on HTMLText#Summary and HTMLText#FirstSentence so the trickiest tests pass 

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@78728 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:29 +13:00
Sam Minnee
8aea22c283 API CHANGE: Added increase_memory_limit_to() for increasing but not decreasing memory limit.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@78632 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:29 +13:00
Sean Harvey
1c896b192c BUGFIX #4133 Fixed case where ComplexTableField failed to detect a has_many relation from the parent
MINOR Updated tests for ComplexTableField


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@77766 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:27 +13:00
Sam Minnee
1eee3cc54b BUGFIX: Ensure that when a page is deleted from stage or live, its descendants are also deleted.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@77461 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:26 +13:00
Sean Harvey
5a277c7a2c MINOR Added test for has one relation getters in DataObjectTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@77313 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:26 +13:00
Ingo Schommer
56977a0c49 MINOR Merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@77008 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:25 +13:00
Ingo Schommer
aa51d57ada MINOR Merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76842 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:23 +13:00
Sam Minnee
0b0bc49f55 MINOR: Fixed Versioned test and improved virtual page tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76750 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:23 +13:00
Ingo Schommer
518fb12c42 MINOR Merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76597 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:23 +13:00
Ingo Schommer
7e50b9ef1c MINOR Partially merged r70306, r74986, r75027 from trunk, seems like parts have been missed in previous merges
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76593 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:22 +13:00
Sam Minnee
1a996a776f MINOR: Added some more tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76254 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:22 +13:00
Sam Minnee
8c9b7b282c BUGFIX: Fixed extraFilter argument for SiteTree::get_by_url() when translatable is enabled
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76036 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:22 +13:00
Sam Minnee
fafca08c44 MINOR: Merged translatable URL handling fixes from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@76035 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:21 +13:00
Ingo Schommer
5620ba92d1 MINOR merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75937 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:21 +13:00
Ingo Schommer
897d4f193a MINOR Merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75916 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:21 +13:00
Sam Minnee
60958496fc BUGFIX: Automatically publish virtual pages when their source pages are published
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75873 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:21 +13:00
Sean Harvey
45ff4b6a47 MINOR Removed extra data stuff from ComponentSet/ComplexTableField as this is not fully developed yet
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75855 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:21 +13:00
Sean Harvey
7a4b18090c ENHANCEMENT Allow selecting a single field from ComponentSet::getExtraData()
MINOR Removed redundant code from ComplexTableField
MINOR Added more test cases for extra data on ComplexTableFieldTest


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75759 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:20 +13:00
Sean Harvey
0cafc79346 MINOR Added ErrorPageTest for testing standard error, and error with template when the ErrorPage is published
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75752 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:20 +13:00
Ingo Schommer
38a794b97a MINOR Merged from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75746 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:20 +13:00
Sean Harvey
4969a8d145 MINOR Changed test method name in ComplexTableFieldTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75744 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:20 +13:00
Sean Harvey
78d3689729 BUGFIX #3959: Fixed auto-setting has many relations on CTF - works mostly like the many-many relation auto setting.
MINOR Added test cases for auto-setting has-many relations



git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75743 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:20 +13:00
Sean Harvey
faeed904dc #3927 ENHANCEMENT Added support for many-many auto-setting relations with a standard ComplexTableField
MINOR Added tests for ComplexTableField - ComplexTableFieldTest


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75738 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:20 +13:00
Sam Minnee
7861a8f740 ENHANCEMENT: Added Versioned::get_including_deleted(), for querying deleted pages.
ENHANCEMENT: Added childrenMethod argument to Hierarchy tree-generation functions.
ENHANCEMENT: Added 'show deleted pages' function to CMS, with a restore page option.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75736 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:20 +13:00
Ingo Schommer
42e7894f66 MINOR Merged Translatable fixes from trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75685 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:19 +13:00
Sam Minnee
bc7c8330f5 BUGFIX: Updated DataObjectSet::map() to use empty string, rather than 0, as the empty value
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75585 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:19 +13:00
Sam Minnee
54a5dc543f MINOR: Fixes to GroupTest to handle canEdit() restrictions on the groups
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75488 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:19 +13:00
Ingo Schommer
8e72a975b0 MINOR Merged ObjectStaticTest and TranslatableSearchFormTest from trunk, missed when merging the remaining Translatable improvements in r74986
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75157 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:18 +13:00
Sam Minnee
2e4dfa3dc1 BUGFIX #3919: Fix DataObject::dbObject() for decorated fields (Merged from r75150)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75151 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:18 +13:00
Sean Harvey
67e5126ce8 ENHANCEMENT Allow "Yes" and "No" english text to be translated
BUGFIX Fix DropdownField to select the correct option when using a map with "0" as an array key - useful for boolean searching using DropdownField
MINOR Added tests to DropdownFieldTest for asserting the correct OPTION element is selected

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75119 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:18 +13:00
Sean Harvey
ee0275bd2c MINOR Added test method for testing behaviour of menu and search visibility for an error page in ErrorPageTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75115 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:27:17 +13:00