Commit Graph

132 Commits

Author SHA1 Message Date
Damian Mooyman
b552a7370f Merge remote-tracking branch 'origin/3'
Conflicts:
	tests/model/ImageTest.php
2015-09-09 15:44:47 +12:00
Damian Mooyman
309ac0d196 Merge remote-tracking branch 'origin/3.1' into 3.2
Conflicts:
	.travis.yml
	admin/code/CMSProfileController.php
	admin/tests/LeftAndMainTest.php
	control/HTTP.php
	security/Permission.php
	tests/forms/FormTest.php
	tests/model/ArrayListTest.php
	tests/security/PermissionTest.php
2015-09-09 14:35:29 +12:00
Damian Mooyman
fa8702f0c8 BUG Fix reference to missing Debug::loadErrorHandlers() 2015-09-04 15:50:54 +12:00
Stevie Mayhew
0d94cf15a5 UPDATE: change all instances of $this->request to use appropriate getter/setter 2015-04-30 11:04:08 +12:00
Nick
114a5c39c8 Flush should be off by default - consistant
Flushing should be off by default, just like it is when you are on the site normally.

It's not obvious that tests always flush when they run and you have to pass flush=0 to turn them off. People expect to have to flush to clear the cache, and the documentation already covers mentions about flushing

-> http://doc.silverstripe.org/en/developer_guides/testing/unit_testing/
-> phpunit framework/tests '' flush=all
# Run tests with optional `$_GET` parameters (you need an empty second argument)
2015-01-22 22:29:21 +13:00
Damian Mooyman
0b1f297873 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	README.md
	admin/code/LeftAndMain.php
	admin/css/screen.css
	admin/scss/screen.scss
	api/RestfulService.php
	conf/ConfigureFromEnv.php
	control/injector/ServiceConfigurationLocator.php
	control/injector/SilverStripeServiceConfigurationLocator.php
	core/ClassInfo.php
	core/Object.php
	css/AssetUploadField.css
	css/ComplexTableField_popup.css
	dev/CSSContentParser.php
	dev/DevelopmentAdmin.php
	docs/en/changelogs/index.md
	docs/en/misc/contributing/code.md
	docs/en/reference/execution-pipeline.md
	filesystem/GD.php
	filesystem/ImagickBackend.php
	filesystem/Upload.php
	forms/Form.php
	forms/FormField.php
	forms/HtmlEditorConfig.php
	forms/gridfield/GridFieldDetailForm.php
	forms/gridfield/GridFieldSortableHeader.php
	lang/en.yml
	model/Aggregate.php
	model/DataList.php
	model/DataObject.php
	model/DataQuery.php
	model/Image.php
	model/MySQLDatabase.php
	model/SQLQuery.php
	model/fieldtypes/HTMLText.php
	model/fieldtypes/Text.php
	scss/AssetUploadField.scss
	search/filters/SearchFilter.php
	security/Authenticator.php
	security/LoginForm.php
	security/Member.php
	security/MemberAuthenticator.php
	security/MemberLoginForm.php
	security/Security.php
	tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php
	tests/control/HTTPTest.php
	tests/control/RequestHandlingTest.php
	tests/filesystem/UploadTest.php
	tests/forms/FormTest.php
	tests/forms/NumericFieldTest.php
	tests/model/DataListTest.php
	tests/model/DataObjectTest.php
	tests/model/TextTest.php
	tests/security/MemberAuthenticatorTest.php
	tests/security/SecurityDefaultAdminTest.php
	tests/view/SSViewerCacheBlockTest.php
	tests/view/SSViewerTest.php
2014-11-18 12:45:54 +13:00
AntonyThorpe
2d0fe7a4aa Update PhpUnitWrapper.php & TestRunner.php to recommend PHPUnit installation via Composer rather than PEAR
Using the PEAR Installer to install PHPUnit is no longer supported.  See https://github.com/sebastianbergmann/phpunit/wiki/End-of-Life-for-PEAR-Installation-Method.

Replace PEAR in a comment and die output message with Composer.

Signed-off-by: AntonyThorpe <antony.thorpe@budget12.com>
2014-09-08 17:46:09 +12:00
Sean Harvey
2b316e79e5 NEW Provide a consistent way of triggering flush
Provides an interface for classes to implement their own flush()
functionality. This function gets called early in a request on
all implementations of Flushable when flush=1|all is requested in the
URL.

This fix came out of an issue where Requirements combined files were not
being cleaned up after dev/build?flush=1, due to the fact that flush
would only occur when you called it while on a page that used those
combined files, but not in any other contexts. This will now call flush
on any implementors of Flushable regardless of the context of where
flush was called.
2014-08-22 09:24:27 +12:00
Damian Mooyman
eb069e605d Remove all redundant whitespace 2014-08-19 09:17:15 +12:00
Damian Mooyman
7c2eee116f BUG Fix 'undefined index 0' 2014-08-14 12:24:56 +12:00
Damian Mooyman
d8e9af8af8 API New Database abstraction layer. Ticket #7429
Database abstraction broken up into controller, connector, query builder, and schema manager, each independently configurable via YAML / Injector
Creation of new DBQueryGenerator for database specific generation of SQL
Support for parameterised queries, move of code base to use these over escaped conditions
Refactor of SQLQuery into separate query classes for each of INSERT UPDATE DELETE and SELECT
Support for PDO
Installation process upgraded to use new ORM
SS_DatabaseException created to handle database errors, maintaining details of raw sql and parameter details for user code designed interested in that data.
Renamed DB static methods to conform correctly to naming conventions (e.g. DB::getConn -> DB::get_conn)
3.2 upgrade docs
Performance Optimisation and simplification of code to use more concise API
API Ability for database adapters to register extensions to ConfigureFromEnv.php
2014-07-09 18:04:05 +12:00
Hamish Friedlander
a263bed937 Merge pull request #3091 from willmorgan/pulls/testrunner-suites
TestRunner: allow test suite running
2014-05-22 10:32:21 +12:00
Will Morgan
8335de49b3 FIX remove redundant DB name switch in TestRunner
From what I can see, this doesn't actually do anything, except cause an error with cookie setting after HTTP body is sent when tests fail.
2014-05-09 10:15:53 +01:00
Will Morgan
d01cbbbdc7 TestRunner: allow test suite running 2014-05-09 10:03:59 +01:00
Damian Mooyman
e9c3ff933f Merge remote-tracking branch 'origin/3.1'
Conflicts:
	.travis.yml
	composer.json
2014-05-06 10:22:09 +12:00
Simon Welsh
9116e40eb8 Don't add the class manifest with tests as an exclusive manifest 2014-05-04 11:46:06 +10:00
Damian Mooyman
7c60c73dbb API Polymorphic has_one behaviour 2014-03-18 09:18:04 +13:00
Ingo Schommer
474dde8012 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	docs/en/reference/grid-field.md
2013-06-24 14:39:09 +02:00
Craig Weber
d8b106e6ee FIX: TestRunner was not cleaning up DB on failure
When a unit test being run by PHPUnit encountered a fatal error,
TestRunner::tearDown was never being called. This resulted in tmpdb schemas
littering the database from failed test runs. This changeset fixes the issue
by registering TestRunner::tearDown as a shutdown function, so that it gets
called even in the event of a PHP Fatal Error.
2013-06-24 01:15:09 +02:00
Jeremy Thomerson
12cade8126 ENHANCEMENT: Do not attempt to run abstract test classes
There is no reason to try to run test cases of a class that is abstract.  By
skipping them we allow developers to create abstract test case classes that
have test functions in them.  This is especially helpful when someone is
testing multiple implementations of the same service interface.  Most of their
tests can be in the abstract class, and then they can create concrete test
classes for each of their implementations and inherit all of the testing that
is built into the abstract class.
2013-06-03 20:25:08 +00:00
Damian Mooyman
0ee79d43db BUG Fixed major issue with testing dataobjects that implement TestOnly and extend non-TestOnly dataobjects. Database regeneration would incorrectly populate the ClassName column 2013-05-27 16:39:57 +12:00
Ingo Schommer
3334eafcb1 API Marked statics private, use Config API instead (#8317)
See "Static configuration properties are now immutable, you must use Config API." in the 3.1 change log for details.
2013-03-24 17:20:53 +01:00
Hamish Friedlander
6b986cb17d Extract statics via code analysis rather than introspection 2013-02-28 09:43:33 +13:00
Ingo Schommer
2e1a5081fa API Remove dev/tests/startsession etc, use new "testsession" module
Removed commands: startsession, endsession, sessionloadyml, setdb, emptydb.
See https://github.com/silverstripe-labs/silverstripe-testsession
2012-12-19 16:05:37 +01:00
Ingo Schommer
d13c53fda6 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	tests/model/DataQueryTest.php
2012-12-14 10:57:28 +01:00
Ingo Schommer
c6b1d4aa6b API Storing alternative DB name in cookie rather than session
Session is not initialized by the time we need to use
the setting in DB::connect(). Cookie values get initialized
automatically for each request.

Tightened name format validation to ensure it can only
be used for temporary databases, rather than switching
the browser session to a different production database.

Encrypting token for secure cookie usage.
Added dev/generatesecuretoken to generate this token.
Not storing in YML config directly because of web access issues.
2012-12-13 23:21:48 +01:00
Ingo Schommer
6571c17992 Merge remote-tracking branch 'origin/3.0' 2012-12-11 17:16:19 +01:00
Ingo Schommer
e8fbfc0bd1 NEW FixtureFactory separated out from YamlFixture
Enables more generic use of the fixture facilities
without dependency on the YAML format, for example
when creating fixtures from Behat step definitions.

Note: The YamlFixture class needs to be created via
Injector::inst()->create('YamlFixture') now,
direct instantiation is no longer supported.
2012-12-11 17:06:27 +01:00
Will Rossiter
683db8dc1d API Explicitly load project template files after modules
Resolves an issue where if not using the themes directory (i.e just a single app folder) you cannot override module templates.
Changes the SS_TemplateManifest constructor with a new $project argument.
2012-12-04 10:47:37 +01:00
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
Saophalkun Ponlu
60987acbdb Various minor visual enhancements for Sapphire test report 2012-09-01 11:58:52 +12:00
Michał Ochman
1432a8e8a1 NEW create TestRunner setdb URL endpoint 2012-08-08 10:46:53 +02:00
Ingo Schommer
342f076f62 Revert "NEW add selectsession URL endpoint"
This reverts commit 766b03f360.
Accidentally pushed from local working copy.
2012-08-08 10:20:36 +02:00
Michał Ochman
766b03f360 NEW add selectsession URL endpoint
This endpoint should be passed a testSessionKey POST parameter.
testSessionKey is an indicator for /tmp/testsessions/<testSessionKey>
file which stores temp database config.

https://github.com/michalochman/SilverStripe-Behaviour-Testing-Framework/issues/27
2012-08-07 09:14:28 +02:00
Ingo Schommer
64669938da Warning when running tests without flush=1
This is now the default setting for both "sake" and "phpunit"
runs, because of performance reasons (every manifest flush takes
multiple seconds). On the other hand, we want to make errors
like missing classes more obvious to developers.
See discussion in https://github.com/silverstripe/sapphire/pull/620
2012-07-06 12:01:21 +02:00
Will Rossiter
eb2a0427cc MINOR: exclude functional tests when running just framework module tests 2012-06-20 16:27:57 +02:00
Sam Minnee
fb48ec54f4 BUGFIX: Fixed unreliability in SapphireTest::getCurrentAbsolutePath() 2012-05-28 14:25:34 +12:00
Sean Harvey
b65dff0fbe BUGFIX Allowing actions related to coverage tests 2012-05-18 16:05:05 +12:00
Sean Harvey
16e950cb6a MINOR Tidy up of code formatting in TestRunner
MINOR Fixing up old ObjectStaticTest and merging into ConfigTest
2012-04-18 23:29:54 +12:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Simon Welsh
3a6341a251 API-CHANGE sapphire folder can now be renamed. 2012-04-15 10:50:19 +12:00
Sam Minnee
a5e809be49 BUGFIX: Fixed dev/tests/startsession form action 2012-03-05 14:36:38 +13:00
Stig Lindqvist
2101d3c09b MINOR Added codecoverage on a single test to the allowed actions 2011-09-27 11:00:28 +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
ajshort
c34105438c FEATURE: Replaced the template manifest with SS_TemplateLoader, which finds templates from a stack of SS_TemplateManifest objects. 2011-03-24 21:30:57 +11:00
ajshort
0c78935db4 API CHANGE: Replaced ManifestBuilder::load_test_manifest() calls with new function TestRunner::use_test_manifest(), which pushes a test manifest onto the class loader. 2011-03-24 20:14:43 +11:00
Ingo Schommer
9d10e88ea5 Revert "API CHANGE Removing support for PHPUnit 3.4 (3.5.0 has been released in Sept 2010). Removing PhpUnitWrapper_3_4, and adding better version detection." - too many complications with our build environments running mixed versions of SilverStripe
This reverts commit 23e342ce03.
2011-03-11 14:45:49 +13:00
Sam Minnee
d045970d83 Merge remote branch 'origin/master' 2011-02-22 10:57:59 +13:00
Sam Minnee
27246ce982 MINOR: Fixed 2.4 mergeback 2011-02-22 10:53:58 +13:00