Commit Graph

795 Commits

Author SHA1 Message Date
Ingo Schommer
f3c0669fec Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	_config/uploadfield.yml
	css/UploadField.css
	forms/UploadField.php
	scss/UploadField.scss
	templates/UploadField.ss
	tests/forms/uploadfield/UploadFieldTest.php
2013-01-11 10:02:39 +01:00
Ingo Schommer
e8bfc241fd Setting SapphireTest::is_running_test() in PHPUnit bootstrap
Otherwise conditional logic will only succeed
when run through "sake dev/tests", not when
run through phpunit directly (which is the recommended way now)
2013-01-09 23:31:10 +01:00
Ingo Schommer
79997477b3 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	model/DataList.php
2013-01-08 17:16:09 +01:00
Sean Harvey
b63e55a77a Merge pull request #993 from halkyon/htaccess_fix
Fixing .htaccess to ignore rewriting PHP files directly
2013-01-06 17:24:49 -08:00
Ingo Schommer
8ec3641e60 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	admin/javascript/LeftAndMain.FieldHelp.js
	lang/en.yml
	model/URLSegmentFilter.php
2012-12-21 15:04:17 +01:00
Ingo Schommer
6bcffd66ad Merge pull request #1063 from drzax/log-file-formatter-fix
BUGFIX Ensure  has length before using string index access.
2012-12-20 10:19:03 -08:00
Ingo Schommer
9ffd25225e Don't complain about pre-replaced YAML fixture relations 2012-12-20 12:46:56 +01:00
Simon Elvery
1a4eaaaf04 BUGFIX Ensure has length before using string index access. 2012-12-20 12:27:09 +10: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
546d202f3a Don't complain about pre-replaced YAML fixture relations 2012-12-17 15:33:12 +01:00
Ingo Schommer
c5c2df2323 Merge remote-tracking branch 'origin/3.0' into 3.1 2012-12-17 11:54:40 +01:00
Ingo Schommer
e8f3e7b36e Only reset test state in SapphireTest if its previously been set
That's not the case e.g. if the *first* test in a suite
is skipped, so setUp() is never executed completely.
2012-12-17 11:44:08 +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
f41f307118 Fixed spacing 2012-12-14 00:09:30 +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
f03ad7b0dd Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	admin/javascript/LeftAndMain.AddForm.js
	control/Director.php
	control/HTTPResponse.php
	dev/Profiler.php
	email/Mailer.php
	forms/ComplexTableField.php
	forms/ManyManyComplexTableField.php
	forms/SimpleImageField.php
	forms/TableField.php
	forms/TableListField.php
	javascript/ComplexTableField.js
	javascript/ImageFormAction.js
	javascript/TableField.js
	javascript/TableListField.js
	security/Member.php
	tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php
	tests/forms/TableListFieldTest.php
2012-12-12 10:11:56 +01:00
Sam Minnée
b618909220 Merge pull request #1007 from simonwelsh/indent-sniff
Add codesniffer that ensures indentation is with tabs
2012-12-11 20:46:47 -08:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13: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
Simon Welsh
fc5dd2994c Add codesniffer that ensures indentation is with tabs. 2012-12-12 00:12:11 +13: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
Sean Harvey
449cce95a7 Fixing .htaccess to ignore rewriting PHP files directly 2012-12-04 14:36:59 +13:00
Ingo Schommer
15a687f1e7 Merge remote-tracking branch 'origin/3.0' 2012-11-23 15:31:08 +01:00
Ingo Schommer
aa72425e84 Fixed PHPUnit assertions for incomplete tests in core
Avoid PHPUnit throwing "test didn't run any assertions"
notices in PHP. If nothing else, it keeps test output
looking less broken by default, making it more likely
that actual errors do get noticed.
2012-11-23 15:16:39 +01:00
Ingo Schommer
453d04e4ba BUG Reset DataObject caches in SapphireTest->resetDBSchema()
This became a problem with fdcd7a2e where $custom_database_fields
were cached, but never reset. It lead to extensions not applying
correctly in SapphireTest->setUpOnce().
2012-11-23 11:14:02 +01:00
Ingo Schommer
a3cd7ddc09 BUG Force SapphireTest schema reset for extension changes
Previously changes to $requiredExtensions and $illegalExtensions
didn't cause a reset unless there was also other schema-altering
settings like $extensionsToRemove or $extraDataObjects
2012-11-23 11:12:03 +01:00
Sean Harvey
6a868e79e1 Removing deprecated prototype/behaviour libraries 2012-11-16 11:37:56 +13:00
Sean Harvey
26a3c1cf4a Re-adding Debug::caller() which was inadvertently removed in 9eca2d6 2012-11-15 14:56:43 +13:00
Sean Harvey
9eca2d676f Removing deprecated Debug functions, use SS_Log and SS_Backtrace instead 2012-11-15 14:43:14 +13:00
Andrew O'Neil
0c8de0a1de APICHANGE: Use late static binding for Object::has_extension() 2012-11-07 11:07:55 +13:00
Andrew O'Neil
6dd6a5c188 APICHANGE: Use late static binding for Object::remove_extension() 2012-11-07 11:07:55 +13:00
Andrew O'Neil
fdea5321c7 APICHANGE: add_extension() is now called directly on the class, instead of on Object 2012-11-07 11:07:55 +13:00
Simon Welsh
bedb579b07 Merge branch '3.0' 2012-10-23 15:21:20 +13:00
Damian Mooyman
0d7816b55d BUG Fixed issue with Deprecation failing to extract the module from a stacktrace, especially on non-unix systems
API Added Convert::nl2os function to normalise end of line characters across systems with tests
BUG Fixed i18n unit tests in non-unix systems constantly failing
BUG Fixed problems with HTMLCleaner tests failing in non-unix systems
2012-10-17 11:57:16 +13:00
Sean Harvey
f6a90467e4 Merge branch '3.0' 2012-10-15 10:10:01 +13:00
Sean Harvey
9bb190813f Fixing BulkLoader to use increase_time_limit_to() 2012-10-11 17:12:27 +13:00
Ingo Schommer
d1ee7612f5 Merge remote-tracking branch 'origin/3.0' 2012-10-08 16:48:52 +02:00
Normann Lou
9aaa6b1a7b ENHANCEMENT: change those harded-coded 'sapphire' to 'framework' either in javascript code or inline document, or a <a> href propty. 2012-10-05 17:00:39 +13:00
Simon Welsh
5768e421dc Merge branch '3.0' 2012-10-05 14:40:32 +13:00
Simon Elvery
de36063d15 ENHANCEMENT Make it possible to extend SS_Log
Using late static binding makes it possible to override SS_Log to create
logs which are separate to the main Silverstripe log but still use the
built in functionality.

Add test for SS_Log subclassing.
2012-10-04 16:34:20 +10:00
Ingo Schommer
56f7ce1dcf Merge remote-tracking branch 'origin/3.0'
Conflicts:
	control/Cookie.php
	control/Director.php
	control/HTTPResponse.php
	model/Database.php
	model/MySQLDatabase.php
	model/SQLQuery.php
	view/Requirements.php
	view/SSViewer.php
2012-10-03 16:16:19 +02: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
Sean Harvey
2654290848 Merge pull request #811 from wilr/removestatic
API: Remove static main and dev/buildcache
2012-09-24 19:12:35 -07:00
Simon Welsh
0470219cb1 FIX Output the title of the task instead of Array when listing in the CLI 2012-09-24 13:37:48 +12:00
Will Rossiter
e72114dad7 API: Remove static main and dev/buildcache
Files moved to a separate module (silverstripe-static).
2012-09-21 19:56:56 +12:00
Simon Welsh
1e629f4585 Merge branch '3.0'
Conflicts:
	control/Cookie.php
	control/Director.php
	dev/Profiler.php
	view/Requirements.php
2012-09-21 14:56:56 +12:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Simon Welsh
d0153f32cf Write the test before ending it, so it still exists.
Also, switches to a constant instead of hardcoding the value.
2012-09-19 21:41:34 +12:00
Damian Mooyman
69d888b5d1 FIXED: Issue with test reporting not correctly presenting errors that prevent test execution.
In the case of errors arising during setUp or setUpOnce a unit test will fail to run any individual tests. However, this situation was incorrectly being reported as a test pass (as no tests were run, thus no tests had errors). E.g. the output of a test run that raised an error during setUp would be "0 tests run: 0 passes, 0 failures, and 0 incomplete" with a green background.

To rectify this the following fixes were made:
- Non-cleanly ended tests and test suites are now automatically ended at the end of the test run, as well as at the beginning of subsequent test/suites. This should make catching of errors a lot more robust.
- Errors raised during setup are now no longer lost to the mist of time. The test suite itself will record any error status which was generated outside the scope of any individual tests.
- An additional "errors" count is added to the output at the end of test running. For example, in the case where setup failed and no tests could be run the error would be written to the browser (along with stacktrace) with a message similar to "0 tests run: 0 passes, 0 failures, and 0 incomplete with 1 errors". The intent of this is to separate the concepts of failed/succeeded/incomplete tests from any errors which may have arisen. I.e. no tests "failed" due to the error, but the test run itself is highlighted as an error (red background on the output).

This problem has been a severe cause of issue when testing code that interacts with the database, as any database error during setup would refuse to be shown.
2012-09-19 12:25:58 +12:00