Commit Graph

183 Commits

Author SHA1 Message Date
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Andrew O'Neil
3fd4f7e855 BUGFIX: Fix loading of fixtures not specified in $fixtures array 2012-09-05 14:26:43 +12:00
Sam Minnee
114ebb6953 API CHANGE: Don't have any instance caching in singleton(), rely on Injector for this. 2012-06-11 22:41:12 +12:00
Marcus Nyeholt
82a1e7d282 MINOR Use injector for creating Member_GroupSet object
MINOR Use injector for creating many many list objects

MINOR Use injector for creating objects from within the DataList

MINOR Use Injector::inst() for creating objects; cannot rely on this->injector being present due to many classes being created with 'new', so use inst() directly

MINOR Remove injector autoset property for now; automatically setting it breaks a few test cases that don't know about it for now, and it's not needed just yet
2012-06-05 01:33:44 +10:00
Sam Minnee
fb48ec54f4 BUGFIX: Fixed unreliability in SapphireTest::getCurrentAbsolutePath() 2012-05-28 14:25:34 +12:00
Marcus Nyeholt
82495f5a7e BUGFIX Versioned's constructor doesn't provide suitable defaults. Previously a bug/feature in singleton, where it would pass null,true as params to strong_create, which would then get passed through as params to Versioned's constructor, meant that the code still executed fine (as was set to something that wasn't an array, so the null and true were instead taken as args). The fact that the usage of singleton(Versioned) never really used the classes code, purely for value lookup, meant that this never propagated errors. I've now switched singleton() to use the injector for retrieving values, which means these dud values are no longer passed through
CHANGE Given that Config::inst is an implementation of the singleton pattern itself, I've removed the extra call to singleton(). A side effect of this is that it gets around a possibly nasty circular reference with the dependency injector (which relies on the config object); in future, this dependency structure should really be structured from the DI directly.

MINOR Change singleton and strong_create to use dependency injector

BUGFIX: Provide default constructor values for classes (fixes issues when used in 'singleton' scenario during dev/build in particular)

MINOR Clear out injector state when resetting db schema during tests (a follow on from changing singleton() calls to use the injector underneath)
2012-05-23 21:10:04 +10:00
Sean Harvey
b1e17578c7 API CHANGE Removed assertType() and assertEmpty() workarounds. Use assertInstanceOf()
instead of assertType(), assertEmpty() is available in PHPUnit 3.5+.
PHPUnit 3.4 is no longer supported, so please upgrade your version to
work.

MINOR Removed FullTestSuite which was a workaround for PHPUnit but not
used.
2012-05-09 23:05:39 +12:00
Sean Harvey
4c6be2931b BUGFIX Removing use of deprecated Object static functions like
get_static(), set_static(), uninherited() etc. Replace with equivalent
Config system get(), update()
2012-04-18 23:10:57 +12:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Will Rossiter
907568b182 ENHANCEMENT: move hard coded template HTML for composite field and field group out to separate template files. 2012-04-14 17:36:08 +12:00
Ingo Schommer
a3d99b082d MINOR Resetting Security::$database_is_ready state during tests (regression from a9509a610d) 2012-04-11 17:22:55 +02:00
Fred Condo
5954774530 BUGFIX: Use UTC consistently across all tests for date/time calculations
This ensures that tests will not pass or fail based on whether the test
machine is on NZ time.

This partially reverts df050eda5d, which has
already been merged. Instead of finding tests that use date calculations, we
are now setting the default time zone in SapphireTest so it will apply to the
whole test suite and any future tests.

Adjust expected values in certain tests for UTC, where the expected values had
previously been expressed in NZ time.

When creating a temp DB for test fixtures, create the DB connection with
timezone UTC.
2012-03-27 10:29:07 -07:00
Andrew O'Neil
6db08cbc36 MINOR: Fix tests on PHPUnit 3.4 2012-03-14 16:05:19 +13:00
Fred Condo
d370423825 Clean up trailing ?> per coding standard
All sapphire but the lang directory
2012-02-12 12:40:16 -08:00
Andrew O'Neil
15a641a99c BUGFIX Clear requirements after running a unit test 2012-02-03 13:07:12 +01:00
Stig Lindqvist
e38dd08ea5 MINOR: Fix docblocks to reference SS_List instead of (now deprecated) DataObjectSet where appropriate 2011-10-28 15:58:55 +13:00
Will Rossiter
37d197c52f MINOR altered skipTest to be a instance property rather than static 2011-09-26 17:11:49 +13:00
Will Rossiter
1732a17114 Merged new-orm into datagrid 2011-09-26 16:47:54 +13:00
Will Rossiter
e740bf8a65 ENHANCEMENT: added SapphireTest:: boolean to flag tests that should be skipped from the TestRunner 2011-09-26 16:08:41 +13:00
Ingo Schommer
ce8e72cf0e MINOR Removing executable flag from all files (thanks miiihi) 2011-09-18 22:04:02 +02:00
Sam Minnee
7fbb919ce8 API CHANGE: Introduce DataModel object, as a representation of the project's entire data model, and tie it to $this->model an all DataObjects, Controllers, and RequestHandlers for easy non-static access.
API CHANGE: Add DataList::newObject(), which creates a new object on that DataList.
API CHANGE: RequestHandler::handleRequest() now needs to handle a $model argument, if you override it.
2011-05-01 17:33:02 +12:00
ajshort
ff3d3816ca MINOR: Updated SapphireTest::dataObjectArrayMatch() to use array_key_exists() rather than isset(). This allows tempting for NULL values in DOS assertion methods. 2011-05-01 15:26:29 +12:00
ajshort
3a1c2df4e7 API CHANGE: Renamed DataObjectDecorator to DataExtension.
API CHANGE: Renamed LeftAndMainDecorator to LeftAndMainExtension.
MINOR: Replaced all references to decorators with extension.
2011-04-26 11:01:38 +10:00
Ingo Schommer
2870eb9212 MINOR Changed $fixture_path to relative filenames in all sapphire test cases in order to allow easier file moving and less verbosity in tests 2011-03-30 23:04:48 +13:00
Ingo Schommer
14e1341df6 ENHANCEMENT Added support for SapphireTest::$fixture_file paths relative to current class location ('MyTest.yml' or '../otherfolder/MyTest.yml'). Added SapphireTest->getCurrentAbsolutePath() and getCurrentRelativePath() for easy access within unit tests 2011-03-30 20:05:22 +13:00
Ingo Schommer
6d18e38278 MINOR Checking for optional classes in 'cms' module in SapphireTest 2011-03-29 18:07:57 +13:00
Ingo Schommer
d61444e976 API CHANGE Moved Translatable class into new 'translatable' module 2011-03-29 18:07:56 +13:00
Ingo Schommer
002e40bd79 MINOR Added deprecated SapphireTest->assertType() in order to support PHPUnit 3.5 or newer, but stay backwards compatible to PHPUnit 3.4 2011-03-11 15:12:17 +13:00
Sam Minnee
1e0c4ae8d1 Merge branch '2.4'
Conflicts:
	cache/Cache.php
	cli/CliController.php
	core/Convert.php
	core/Core.php
	core/ManifestBuilder.php
	core/Object.php
	core/SSViewer.php
	core/control/ContentController.php
	core/control/ContentNegotiator.php
	core/control/FormResponse.php
	core/control/RequestHandler.php
	core/control/SilverStripeNavigatorItem.php
	core/i18n.php
	core/i18nTextCollector.php
	core/model/DataObjectSet.php
	core/model/Hierarchy.php
	core/model/Image.php
	core/model/MySQLDatabase.php
	core/model/SiteConfig.php
	core/model/SiteTree.php
	core/model/Translatable.php
	core/model/VirtualPage.php
	dev/Debug.php
	dev/SapphireTest.php
	dev/TestRunner.php
	dev/YamlFixture.php
	dev/install/MySQLDatabaseConfigurationHelper.php
	docs/en/installation/from-source.md
	docs/en/topics/themes.md
	docs/en/tutorials/4-site-search.md
	email/Mailer.php
	filesystem/File.php
	filesystem/Folder.php
	forms/ComplexTableField.php
	forms/CurrencyField.php
	forms/DateField.php
	forms/FieldSet.php
	forms/FileField.php
	forms/FileIFrameField.php
	forms/HtmlEditorConfig.php
	forms/HtmlEditorField.php
	forms/SelectionGroup.php
	forms/SimpleImageField.php
	forms/TabSet.php
	forms/TableField.php
	forms/TableListField.php
	forms/TreeDropdownField.php
	forms/TreeMultiselectField.php
	integration/Geoip.php
	javascript/SelectionGroup.js
	javascript/TreeSelectorField.js
	javascript/UpdateURL.js
	javascript/core/jquery.ondemand.js
	javascript/tiny_mce_improvements.js
	javascript/tree/tree.js
	lang/en_US.php
	search/ContentControllerSearchExtension.php
	security/Group.php
	security/Member.php
	security/PermissionCheckboxSetField.php
	security/PermissionRole.php
	security/Security.php
	static-main.php
	templates/RelationComplexTableField.ss
	templates/TableListField.ss
	tests/ConvertTest.php
	tests/DataObjectSetTest.php
	tests/DataObjectTest.php
	tests/DataObjectTest.yml
	tests/RequestHandlingTest.php
	tests/SSViewerTest.php
	tests/SiteTreePermissionsTest.php
	tests/SiteTreeTest.php
	tests/TransactionTest.php
	tests/api/RestfulServiceTest.php
	tests/control/DirectorTest.php
	tests/control/ModelAsControllerTest.php
	tests/fieldtypes/WidgetAreaEditorTest.php
	tests/forms/CurrencyFieldTest.php
	tests/forms/FormTest.php
	tests/model/DatabaseTest.php
	tests/model/ImageTest.php
	tests/search/ContentControllerSearchExtensionTest.php
	tests/security/MemberAuthenticatorTest.php
	thirdparty/.gitignore
	thirdparty/behaviour/behaviour.js
	thirdparty/firebug-lite/firebug.js
	thirdparty/firebug-lite/firebugx.js
	thirdparty/jquery-form/jquery.form.js
	thirdparty/jquery-livequery/jquery.livequery.js
	thirdparty/jquery-livequery/test/jquery.js
	thirdparty/jquery-livequery/test/test.html
	thirdparty/jquery-livequery/test/test2.html
	thirdparty/jquery-metadata/META.json
	thirdparty/jquery-metadata/README
	thirdparty/jquery-metadata/jquery.metadata.js
	thirdparty/jquery-metadata/test/index.html
	thirdparty/jquery-metadata/test/jquery.js
	thirdparty/jquery-metadata/test/test.js
	thirdparty/jquery-metadata/test/testrunner.js
	thirdparty/jquery-metadata/test/testsuite.css
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-icons_222222_256x240.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-icons_2e83ff_256x240.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-icons_454545_256x240.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-icons_888888_256x240.png
	thirdparty/jquery-ui-themes/smoothness/images/ui-icons_cd0a0a_256x240.png
	thirdparty/jquery-ui/i18n/jquery-ui-i18n.js
	thirdparty/jquery-ui/i18n/ui.datepicker-ar.js
	thirdparty/jquery-ui/i18n/ui.datepicker-bg.js
	thirdparty/jquery-ui/i18n/ui.datepicker-ca.js
	thirdparty/jquery-ui/i18n/ui.datepicker-cs.js
	thirdparty/jquery-ui/i18n/ui.datepicker-da.js
	thirdparty/jquery-ui/i18n/ui.datepicker-de.js
	thirdparty/jquery-ui/i18n/ui.datepicker-el.js
	thirdparty/jquery-ui/i18n/ui.datepicker-eo.js
	thirdparty/jquery-ui/i18n/ui.datepicker-es.js
	thirdparty/jquery-ui/i18n/ui.datepicker-fa.js
	thirdparty/jquery-ui/i18n/ui.datepicker-fi.js
	thirdparty/jquery-ui/i18n/ui.datepicker-fr.js
	thirdparty/jquery-ui/i18n/ui.datepicker-he.js
	thirdparty/jquery-ui/i18n/ui.datepicker-hr.js
	thirdparty/jquery-ui/i18n/ui.datepicker-hu.js
	thirdparty/jquery-ui/i18n/ui.datepicker-hy.js
	thirdparty/jquery-ui/i18n/ui.datepicker-id.js
	thirdparty/jquery-ui/i18n/ui.datepicker-is.js
	thirdparty/jquery-ui/i18n/ui.datepicker-it.js
	thirdparty/jquery-ui/i18n/ui.datepicker-ja.js
	thirdparty/jquery-ui/i18n/ui.datepicker-ko.js
	thirdparty/jquery-ui/i18n/ui.datepicker-lt.js
	thirdparty/jquery-ui/i18n/ui.datepicker-lv.js
	thirdparty/jquery-ui/i18n/ui.datepicker-ms.js
	thirdparty/jquery-ui/i18n/ui.datepicker-nl.js
	thirdparty/jquery-ui/i18n/ui.datepicker-no.js
	thirdparty/jquery-ui/i18n/ui.datepicker-pl.js
	thirdparty/jquery-ui/i18n/ui.datepicker-pt-BR.js
	thirdparty/jquery-ui/i18n/ui.datepicker-ro.js
	thirdparty/jquery-ui/i18n/ui.datepicker-ru.js
	thirdparty/jquery-ui/i18n/ui.datepicker-sk.js
	thirdparty/jquery-ui/i18n/ui.datepicker-sl.js
	thirdparty/jquery-ui/i18n/ui.datepicker-sq.js
	thirdparty/jquery-ui/i18n/ui.datepicker-sr-SR.js
	thirdparty/jquery-ui/i18n/ui.datepicker-sr.js
	thirdparty/jquery-ui/i18n/ui.datepicker-sv.js
	thirdparty/jquery-ui/i18n/ui.datepicker-th.js
	thirdparty/jquery-ui/i18n/ui.datepicker-tr.js
	thirdparty/jquery-ui/i18n/ui.datepicker-uk.js
	thirdparty/jquery-ui/i18n/ui.datepicker-zh-CN.js
	thirdparty/jquery-ui/i18n/ui.datepicker-zh-TW.js
	thirdparty/jquery/jquery.js
	thirdparty/jsmin/.piston.yml
	thirdparty/jsmin/jsmin.php
	thirdparty/prototype/prototype.js
	thirdparty/scriptaculous/dragdrop.js
	thirdparty/simplepie/.piston.yml
	thirdparty/spyc/.piston.yml
	thirdparty/spyc/README
	thirdparty/spyc/php4/spyc.php4
	thirdparty/spyc/php4/test.php4
	thirdparty/spyc/spyc.php
	thirdparty/spyc/spyc.yaml
	thirdparty/tinymce-advcode/dialog.html
	thirdparty/tinymce-advcode/editor_plugin_src.js
	thirdparty/tinymce-advcode/js/dialog.js
	thirdparty/tinymce/langs/en.js
	thirdparty/tinymce/plugins/advhr/langs/en_dlg.js
	thirdparty/tinymce/plugins/advhr/rule.htm
	thirdparty/tinymce/plugins/advimage/image.htm
	thirdparty/tinymce/plugins/advimage/langs/en_dlg.js
	thirdparty/tinymce/plugins/advlink/langs/en_dlg.js
	thirdparty/tinymce/plugins/advlink/link.htm
	thirdparty/tinymce/plugins/emotions/emotions.htm
	thirdparty/tinymce/plugins/emotions/langs/en_dlg.js
	thirdparty/tinymce/plugins/example/dialog.htm
	thirdparty/tinymce/plugins/fullpage/fullpage.htm
	thirdparty/tinymce/plugins/fullpage/langs/en_dlg.js
	thirdparty/tinymce/plugins/fullscreen/fullscreen.htm
	thirdparty/tinymce/plugins/inlinepopups/template.htm
	thirdparty/tinymce/plugins/media/langs/en_dlg.js
	thirdparty/tinymce/plugins/media/media.htm
	thirdparty/tinymce/plugins/paste/js/pasteword.js
	thirdparty/tinymce/plugins/paste/langs/en_dlg.js
	thirdparty/tinymce/plugins/paste/pastetext.htm
	thirdparty/tinymce/plugins/paste/pasteword.htm
	thirdparty/tinymce/plugins/searchreplace/langs/en_dlg.js
	thirdparty/tinymce/plugins/searchreplace/searchreplace.htm
	thirdparty/tinymce/plugins/spellchecker/editor_plugin.js
	thirdparty/tinymce/plugins/spellchecker/editor_plugin_src.js
	thirdparty/tinymce/plugins/style/langs/en_dlg.js
	thirdparty/tinymce/plugins/style/props.htm
	thirdparty/tinymce/plugins/table/cell.htm
	thirdparty/tinymce/plugins/table/langs/en_dlg.js
	thirdparty/tinymce/plugins/table/merge_cells.htm
	thirdparty/tinymce/plugins/table/row.htm
	thirdparty/tinymce/plugins/table/table.htm
	thirdparty/tinymce/plugins/template/langs/en_dlg.js
	thirdparty/tinymce/plugins/template/template.htm
	thirdparty/tinymce/plugins/xhtmlxtras/abbr.htm
	thirdparty/tinymce/plugins/xhtmlxtras/acronym.htm
	thirdparty/tinymce/plugins/xhtmlxtras/attributes.htm
	thirdparty/tinymce/plugins/xhtmlxtras/cite.htm
	thirdparty/tinymce/plugins/xhtmlxtras/del.htm
	thirdparty/tinymce/plugins/xhtmlxtras/ins.htm
	thirdparty/tinymce/plugins/xhtmlxtras/langs/en_dlg.js
	thirdparty/tinymce/themes/advanced/about.htm
	thirdparty/tinymce/themes/advanced/anchor.htm
	thirdparty/tinymce/themes/advanced/charmap.htm
	thirdparty/tinymce/themes/advanced/color_picker.htm
	thirdparty/tinymce/themes/advanced/image.htm
	thirdparty/tinymce/themes/advanced/langs/en.js
	thirdparty/tinymce/themes/advanced/langs/en_dlg.js
	thirdparty/tinymce/themes/advanced/link.htm
	thirdparty/tinymce/themes/advanced/source_editor.htm
	thirdparty/tinymce/themes/simple/langs/en.js
	thirdparty/tinymce/tiny_mce.js
	thirdparty/tinymce/tiny_mce_src.js
	widgets/Widget.php
2011-02-14 18:47:53 +13:00
Ingo Schommer
f79c6aeb83 BUGFIX Don't allow HTML formatting in RequestHandler->httpError() by sending "Content-Type: text/plain" response headers. (from r114444)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114445 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:20:03 +13:00
Sean Harvey
cfcf7a5358 MINOR Fixed output spelling mistake and formatting in SapphireTest::delete_all_temp_dbs()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113450 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:59 +13:00
Ingo Schommer
4e8b6b9fd7 BUGFIX Add PHPUnit includes to SapphireTest? class (can be loaded outside of TestRunner? for static calls, in which case the PHPUnit autoloaders/includes aren't in place yet) (merged from r113156)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113157 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:58 +13:00
Ingo Schommer
23590932fa BUGFIX: Allow execution of a test without a current controller.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111044 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:51 +13:00
Ingo Schommer
2343465df4 API-CHANGE: remove include which is not required.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111040 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:51 +13:00
Ingo Schommer
12c3bfb1fb MINOR Documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110847 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:50 +13:00
Sean Harvey
6671b03ecf BUGFIX SapphireTest::create_temp_db() should restore the SS error handler from the PHPUnit one temporarily in case there's any errors building
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108509 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:43 +13:00
Sean Harvey
375696a964 MINOR Fixed failing tests because of locale not being set to the default in SapphireTest::setUp()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108500 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:43 +13:00
Ingo Schommer
8dee93b523 BUGFIX Allowing dev/build in "live" mode when Security::database_is_ready() returns FALSE (typically happens when an existing SilverStripe project is upgraded and database columns in Member/Permission/Group have been added) (fixes #4957)
MINOR Using Object::create() in DevelopmentAdmin to make objects mockable
ENHANCEMENT Added Security::$force_database_is_ready to mock database_is_ready() state
ENHANCEMENT Added permission check exception in TaskRunner and DatabaseAdmin if SapphireTest::is_running_test() returns TRUE (necessary for DevelopmentAdminTest)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@107415 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:36 +13:00
Sean Harvey
3be26a4cec ENHANCEMENT #5352 Decouple date display from i18n locales, users now have access to change their date and time formats in Member::getCMSFields() using Member_DatetimeOptionsetField field
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@107326 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:35 +13:00
Ingo Schommer
a50d4fbc10 MINOR Fixed memory limit setting in SapphireTest (regression from r106128)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@106190 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:31 +13:00
Sam Minnee
2f9dddc0ea MINOR: Preserve memory_limit between tests (for better PHP5.1 behaviour)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@106128 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:30 +13:00
Sam Minnee
4d19553254 API CHANGE: Allow on_db_reset() methods on DataObjects as well as DataObjectDecortators
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101119 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:02 +13:00
Tom Rix
8764524695 MINOR tests can now require default records on classes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101025 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:59 +13:00
Ingo Schommer
83675fc248 BUGFIX Fixed SapphireTest->loginWithPermission() and MemberAuthenticatorTest to use existing Members based on their unique_identifier_field (if existing) to accommodate recent Member->onBeforeWrite() changes (see r100705)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100723 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:51 +13:00
Sean Harvey
87c03b4750 BUGFIX If fixture file is NULL don't cause the test framework to break down because of it
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100548 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:48 +13:00
Ingo Schommer
508ead95e9 MINOR Fixed SapphireTest->logInWithPermission() spelling
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99491 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:38 +13:00
Ingo Schommer
7a6da70076 BUGFIX Enforcing creation of temp database in SapphireTest->setUp() to avoid writing to production databases. This check should only kick in for single test case runs, as the temp database connection should be set in a dev/tests/all run after the first db-related test anyway. (see #5034)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99342 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:37 +13:00
Ingo Schommer
d335bf671b API CHANGE: Let any DataObjectDecorator define an on_db_reset() method that is called by tests, like in Versioned. (from r97734)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99051 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:34 +13:00
Mateusz Uzdowski
9769a488dc BUGFIX: testing framework needs to be reset to a clean state after each test: now also nested urls and redirection state will be reverted
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98944 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:32 +13:00
Mateusz Uzdowski
f3da2c48bf REVERT: reverse merging the change, it breaks some tests.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98873 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:32 +13:00
Mateusz Uzdowski
78ec32508e BUGFIX: restore the original nested_urls state after running the test, so we can enable and disable nested URLs within the tests safely.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98860 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:32 +13:00
Sam Minnee
0b8fddc316 MINOR: Preserve theme settings in tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97920 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:18 +13:00
Sam Minnee
46b9ce6988 BUGFIX: Another bugfix for r97583
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97593 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:14 +13:00
Sam Minnee
aacaa2569b BUGFIX: Fixed bug that was caused by r97583
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97589 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:14 +13:00
Sam Minnee
078412eedd MINOR: Fixed bugs with test execution.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96829 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:08 +13:00
Sam Minnee
252fbf0ba7 BUGFIX: Don't let Versioned archive tables clutter the global state when testing.
BUGFIX: Don't let mocked datetimes clutter the global state when testing. (from r96640) (from r96648)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96774 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:07 +13:00
Sam Minnee
ab40216c4a MINOR: Give all test ADMIN privileges by default (from r92208)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96747 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:05 +13:00
Sam Minnee
63096cfefb API CHANGE: Don't generate TestOnly DataObjects in the database immediately; instead let test developers specify them in SapphireTest::$extraDataObjects.
API CHANGE: Added SapphireTest::resetDBSchema() (from r90054)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96734 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:04 +13:00
Sam Minnee
18a71a3fdb MINOR: Flush get_one cache after rebuilding database schema. (from r89966)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96730 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:04 +13:00
Sam Minnee
5296f59d23 API CHANGE: Renamed SapphireTest::set_up_once/tear_down_once to setUpOnce/tearDownOnce, and made them instance methods.
API CHANGE: Added SapphireTest::$illegalExtensions and SapphireTest::$requiredExtensions for making tests depending on particular extension sets (from r89958)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96727 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:03 +13:00
Sean Harvey
b3bb0a721a MINOR Make test database name all lowercase in case some databases like PostgreSQL have issues trying to detect temp database in use
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@115251 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-21 04:46:43 +00:00
Sean Harvey
ec2ce32245 ENHANCEMENT #5442 SapphireTest now creates a "tmpdb" database name with a prefix, changed by defining SS_DATABASE_PREFIX. Defaults to "SS_" to namespace SilverStripe temporary database names
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114819 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-11 05:27:34 +00:00
Sam Minnee
a2475141c6 MINOR Fixed output spelling mistake and formatting in SapphireTest::delete_all_temp_dbs() (from r113450)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114536 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-12-05 08:35:48 +00:00
Ingo Schommer
46dcd20e34 BUGFIX Add PHPUnit includes to SapphireTest class (can be loaded outside of TestRunner for static calls, in which case the PHPUnit autoloaders/includes aren't in place yet)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@113156 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-27 19:59:38 +00:00
Sam Minnee
67b5116702 BUGFIX: Allow execution of a test without a current controller. (from r111044)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112882 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 03:36:12 +00:00
Sam Minnee
ce92190465 API-CHANGE: remove include which is not required. (from r111040)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112872 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 03:07:15 +00:00
Sam Minnee
d8a8635374 API CHANGE Member->canEdit() returns false if the editing member has lower permissions than the edited member, for example if a member with CMS_ACCESS_SecurityAdmin permissions tries to edit an ADMIN (fixes #5651) (from r110856)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112861 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 02:46:26 +00:00
Sam Minnee
b2c7c944de BUGFIX SapphireTest::create_temp_db() should restore the SS error handler from the PHPUnit one temporarily in case there's any errors building (from r108509)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112755 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 00:42:53 +00:00
Sam Minnee
d28d7510af MINOR Fixed failing tests because of locale not being set to the default in SapphireTest::setUp() (from r108500)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112754 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-19 00:37:55 +00:00
Ingo Schommer
f63751893b BUGFIX Allowing dev/build in "live" mode when Security::database_is_ready() returns FALSE (typically happens when an existing SilverStripe project is upgraded and database columns in Member/Permission/Group have been added) (fixes #4957)
MINOR Using Object::create() in DevelopmentAdmin to make objects mockable
ENHANCEMENT Added Security::$force_database_is_ready to mock database_is_ready() state
ENHANCEMENT Added permission check exception in TaskRunner and DatabaseAdmin if SapphireTest::is_running_test() returns TRUE (necessary for DevelopmentAdminTest) (from r107415)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112588 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 03:43:30 +00:00
Ingo Schommer
47762cdf5b ENHANCEMENT #5352 Decouple date display from i18n locales, users now have access to change their date and time formats in Member::getCMSFields() using Member_DatetimeOptionsetField field (from r107326)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112568 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 03:23:02 +00:00
Ingo Schommer
5fe548f7b5 MINOR Fixed memory limit setting in SapphireTest (regression from r106128) (from r106190)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112525 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 02:59:10 +00:00
Ingo Schommer
3c18a9f1f6 MINOR: Preserve memory_limit between tests (for better PHP5.1 behaviour) (from r106128)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112521 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-15 02:58:02 +00:00
Sam Minnee
55c5d1cab7 API CHANGE: Allow on_db_reset() methods on DataObjects as well as DataObjectDecortators (from r101119)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111593 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-04 04:51:08 +00:00
Sam Minnee
848faf2a6b MINOR tests can now require default records on classes (from r101025)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111566 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-04 04:31:58 +00:00
Ingo Schommer
e4dfc243b4 BUGFIX Fixed SapphireTest->loginWithPermission() and MemberAuthenticatorTest to use existing Members based on their unique_identifier_field (if existing) to accommodate recent Member->onBeforeWrite() changes (see r100705) (from r100723)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105628 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 04:24:53 +00:00
Ingo Schommer
53ed23d8b6 BUGFIX If fixture file is NULL don't cause the test framework to break down because of it (from r100548)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105601 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-05-25 04:17:21 +00:00
Ingo Schommer
4703aa6e81 MINOR Fixed SapphireTest->logInWithPermission() spelling (from r99491)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102866 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 04:41:30 +00:00
Ingo Schommer
7452c4c584 API CHANGE: Let any DataObjectDecorator define an on_db_reset() method that is called by tests, like in Versioned. (from r97734) (from r99051)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102827 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 03:53:44 +00:00
Ingo Schommer
5dcf53c239 BUGFIX: testing framework needs to be reset to a clean state after each test: now also nested urls and redirection state will be reverted (from r98944)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102815 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 03:49:06 +00:00
Ingo Schommer
afb7b5eda5 REVERT: reverse merging the change, it breaks some tests. (from r98873)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102810 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 03:47:19 +00:00
Ingo Schommer
dcd5ef9c77 BUGFIX: restore the original nested_urls state after running the test, so we can enable and disable nested URLs within the tests safely. (from r98860)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102806 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-14 03:46:23 +00:00
Ingo Schommer
7c84bb984e MINOR: Preserve theme settings in tests (from r97920)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102555 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 01:44:45 +00:00
Ingo Schommer
43ff00ebd6 BUGFIX Enforcing creation of temp database in SapphireTest->setUp() to avoid writing to production databases. This check should only kick in for single test case runs, as the temp database connection should be set in a dev/tests/all run after the first db-related test anyway. (see #5034) (from r99342)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102462 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 08:28:06 +00:00
Ingo Schommer
a09263e572 BUGFIX: Another bugfix for r97583 (from r97593)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102458 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 05:39:48 +00:00
Ingo Schommer
9e9ec33dd3 MINOR: Fixed bugs with test execution. (from r96829)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102404 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 03:24:29 +00:00
Ingo Schommer
9fc3256025 BUGFIX: Don't let Versioned archive tables clutter the global state when testing.
BUGFIX: Don't let mocked datetimes clutter the global state when testing. (from r96640) (from r96648) (from r96774)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102403 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 03:21:30 +00:00
Ingo Schommer
7c14bd233a MINOR: Give all test ADMIN privileges by default (from r92208) (from r96747)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102374 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 02:36:14 +00:00
Ingo Schommer
e19d18d3c9 BUGFIX: Fixed bug that was caused by r97583 (from r97589)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102358 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 02:14:33 +00:00
Ingo Schommer
e921b376bc API CHANGE: Don't generate TestOnly DataObjects in the database immediately; instead let test developers specify them in SapphireTest::$extraDataObjects.
API CHANGE: Added SapphireTest::resetDBSchema() (from r90054) (from r96734)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102356 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 02:03:16 +00:00
Ingo Schommer
19c03a0bd9 MINOR: Flush get_one cache after rebuilding database schema. (from r89966) (from r96730)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102352 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 01:54:33 +00:00
Ingo Schommer
093da7592a API CHANGE: Renamed SapphireTest::set_up_once/tear_down_once to setUpOnce/tearDownOnce, and made them instance methods.
API CHANGE: Added SapphireTest::$illegalExtensions and SapphireTest::$requiredExtensions for making tests depending on particular extension sets (from r89958) (from r96727)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102350 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-12 01:52:39 +00:00
Ingo Schommer
261f8f897a BUGFIX Added Hierarchy::reset() to manually clear marked/expanded states triggered through Hierarchy->markExpanded() etc. This caused side effects when running e.g. CMSMainSearchFormTest and HierarchyTest alongside each other.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93987 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-30 02:24:46 +00:00
Ingo Schommer
ba344f2531 ENHANCEMENT Added SapphireTest->usesDatabase flag to explicitly request building of a test database for a test suite. This is necessitated by r93717, which removed the automatic building of these databases on every run.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93975 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-11-30 01:48:26 +00:00
Ingo Schommer
e1a47de20e BUGFIX Fixing regression in TranslatableTest due to outdated singleton caching.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89911 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-22 00:30:21 +00:00
Ingo Schommer
11d5ce0274 BUGFIX Moved SINGLETON resetting for test runs from SiteTreeTest/ObjectTest into SapphireTest - there should be no caching between all test invocations to avoid side effects
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89893 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-21 23:09:14 +00:00
Sam Minnee
bc6b3804b6 API CHANGE: Added SapphireTest::logInWithPermission() (from r89012)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89209 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 22:40:17 +00:00
ajshort
97ac0008b3 ENHANCEMENT: Cached the value for RootURLController::get_homepage_link() between calls.
From: ajshort <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88504 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:07:22 +00:00
Ingo Schommer
a4cd246a72 BUGFIX Return FALSE in SapphireTest->assertDOSEquals() if no valid DataObjectSet is passed in
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86217 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-14 05:16:15 +00:00