mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7514 from dhensby/pulls/3.5/composer-autoload
Add composer autloading to v3
This commit is contained in:
commit
ef86b16854
@ -29,6 +29,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": ["tests/behat/features/bootstrap"]
|
"psr-0": {
|
||||||
|
"SilverStripe\\": "src/",
|
||||||
|
"Zend_": "thirdparty/Zend/"
|
||||||
|
},
|
||||||
|
"classmap": [
|
||||||
|
"tests/behat/features/bootstrap",
|
||||||
|
"admin/code", "api", "cache", "cli", "control", "core", "dev", "email", "filesystem",
|
||||||
|
"forms", "i18n", "model", "oembed", "parsers", "search", "security", "tasks", "view",
|
||||||
|
"thirdparty/php-peg", "thirdparty/simpletest", "thirdparty/zend_translate_railsyaml"
|
||||||
|
],
|
||||||
|
"exclude-from-classmap": ["view/SSTemplateParser.php.inc", "dev/phpunit/PhpUnitWrapper.php"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ class Injector {
|
|||||||
* @return Injector Reference to new active Injector instance
|
* @return Injector Reference to new active Injector instance
|
||||||
*/
|
*/
|
||||||
public static function nest() {
|
public static function nest() {
|
||||||
$current = self::$instance;
|
$current = self::inst();
|
||||||
|
|
||||||
$new = clone $current;
|
$new = clone $current;
|
||||||
$new->nestedFrom = $current;
|
$new->nestedFrom = $current;
|
||||||
|
@ -223,7 +223,7 @@ class Config {
|
|||||||
* @return Config Reference to new active Config instance
|
* @return Config Reference to new active Config instance
|
||||||
*/
|
*/
|
||||||
public static function nest() {
|
public static function nest() {
|
||||||
$current = self::$instance;
|
$current = self::inst();
|
||||||
|
|
||||||
$new = clone $current;
|
$new = clone $current;
|
||||||
$new->nestedFrom = $current;
|
$new->nestedFrom = $current;
|
||||||
|
@ -171,6 +171,13 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
|
|
||||||
|
if (!defined('FRAMEWORK_PATH')) {
|
||||||
|
trigger_error(
|
||||||
|
'Missing constants, did you remember to include the test bootstrap in your phpunit.xml file?',
|
||||||
|
E_USER_WARNING
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//nest config and injector for each test so they are effectively sandboxed per test
|
//nest config and injector for each test so they are effectively sandboxed per test
|
||||||
Config::nest();
|
Config::nest();
|
||||||
Injector::nest();
|
Injector::nest();
|
||||||
|
Loading…
Reference in New Issue
Block a user