Commit Graph

51 Commits

Author SHA1 Message Date
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
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
Ingo Schommer
fec369531c MINOR Added SiteTree::reset() to unset any in-memory caches (see DataObject::reset()). Using reset() in SapphireTest to avoid caches persisting across multiple tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85337 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-27 06:55:32 +00:00
Ingo Schommer
1a7418c18b BUGFIX Disabled PHPUnit backup of global variables, which caused i18n::_t() calls in subsequent test cases to fail because of a cached empty global
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85330 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-27 04:45:58 +00:00
Sam Minnee
19769e3841 API CHANGE: Added DataObjectSet assertions to SapphireTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85073 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-24 06:14:54 +00:00
Sam Minnee
5f6bee22ba BUGFIX: Added static resetting methods for more reliable test execution.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84147 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-11 04:45:54 +00:00
Ingo Schommer
c389c01f9c MINOR More backwards handling of $this->fixture references in SapphireTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81320 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-08 04:09:10 +00:00
Ingo Schommer
883be66524 MINOR Fixed array/string notation in SapphireTest error messages
BUGFIX Using get_by_id() in DataObjectTest to grab deleted pages, to avoid error messages for missing fixtures from SapphireTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81313 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-08 02:54:01 +00:00
Ingo Schommer
6c505e5ede MINOR Moving user_error() invocations for missing fixtures from YamlFixture into SapphireTest - we shouldn't error out of a single fixture, as the object in question might be contained in another fixture on the same test
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81310 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-08 02:36:05 +00:00
Ingo Schommer
4c78f0e3e5 MINOR Wording in SapphireTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81307 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-08 01:38:01 +00:00
Ingo Schommer
f3959b038d API CHANGE Deprecated use of SapphireTest->fixture to access YML fixtures, please use gateway methods on SapphireTest instead (e.g. $this->objFromFixture() instead of $this->fixture->objFromFixture())
ENHANCEMENT Allowing multiple fixtures to be defined in SapphireTest::$fixture_file through array notation. 
BUGFIX Disabling DataObject validation in YamlFixture->saveIntoDatabase() instead of SapphireTest->setUp()
MINOR Adapted sapphire unit tests to deprecated $this->fixture usage

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81286 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-08 00:06:16 +00:00
Sam Minnee
b93f48790e MINOR: Improved logic of SapphireTest's database deletion code.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79540 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-18 05:01:15 +00:00
Sam Minnee
3e205b632f BUGFIX: Added Versioned::on_db_reset() so that Versioned tests would run properly.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77568 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-21 08:08:01 +00:00
Sam Minnee
392608b0fa ENHANCEMENT: Added db-abstraction for test database creation and removal.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76345 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-07 03:49:15 +00:00
Sean Harvey
76b5adc979 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75579 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-28 23:52:15 +00:00
Ingo Schommer
228b976ce1 ENHANCEMENT Adding SapphireTest::set_up_once() and SapphireTest::tear_down_once() for better test performance with state that just needs to be initialized once per test case (not per test method). Added new SapphireTestSuite to support this through PHPUnit.
ENHANCEMENT Using set_up_once() in TranslatableTest and TranslatableSearchFormTest for better test run performance

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@74941 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-22 03:22:09 +00:00
Sam Minnee
a581e748d9 ENHANCEMENT: Added dev/tests/cleanupdb action to remove test databases
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72463 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-04 07:31:23 +00:00
Andrew O'Neil
635e2c3df6 Merged from 2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72453 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-04 03:44:11 +00:00
Andrew O'Neil
60f75c5ca4 Merged changes from 2.3 branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71172 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-01 23:49:53 +00:00
Sam Minnee
96c5be8252 Updating queries to be more DB agnostic
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66507 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 09:31:14 +00:00
Sam Minnee
2984355f43 Merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66395 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:33:00 +00:00
Sam Minnee
648a459060 Ensure that Requirements backend instance is preserved between tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65507 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 01:13:42 +00:00
Sam Minnee
ffcac733e9 Update test runner so that password validation config isn't tested by default
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62654 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-09-18 03:59:00 +00:00
Sam Minnee
e9615040e1 ENHANCEMENT: Added dev/tests/startsession and dev/tests/endsession to allow the use of fixtures with external test frameworks, such as Windmill
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61627 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-27 08:19:46 +00:00
Sam Minnee
fb822a0924 Better error message if you have forgotten to set fixture_file
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61410 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-22 03:33:25 +00:00
Sam Minnee
ec96a10a20 Removed unnecessary chatter from test runner
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60604 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-13 03:41:54 +00:00
Sam Minnee
12868bab9f Added DatabaseAdmin::clearAllData() to empty out a database.
Improved performance of testrunner so that it doesn't create a new database for each test, instead only once per test run.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60597 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-13 02:47:14 +00:00
Sam Minnee
356a0a706b BUGFIX: Fixed Yaml fixtures for SapphireTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60388 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-11 05:16:08 +00:00
Ingo Schommer
8d0166e298 (merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60265 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-10 23:29:30 +00:00
Ingo Schommer
95d4634e2e (merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60264 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-10 23:17:51 +00:00
Ingo Schommer
a1f37b93eb (merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60258 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-10 22:49:59 +00:00
Ingo Schommer
c1440e0b02 (merged from branches/roa. use "svn log -c <changeset> -g <module-svn-path>" for detailed commit message)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60234 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-09 06:53:26 +00:00
Ingo Schommer
f2a9208831 BUGFIX Making sure TestRunner.php is included in SapphireTest so we can safely call hasPhpUnit()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@58124 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-07-16 03:29:47 +00:00
Mark Rickerby
327b4610d5 moving Debug.php to dev folder
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@55813 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-06-06 04:59:49 +00:00