mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1821 from open-sausages/pulls/4.0/fqn-services
API Rename services to match FQN of interface / classes
This commit is contained in:
commit
58659834c0
@ -1,2 +1,5 @@
|
|||||||
|
---
|
||||||
|
Name: cmsdefaultadmin
|
||||||
|
---
|
||||||
SilverStripe\Admin\AdminRootController:
|
SilverStripe\Admin\AdminRootController:
|
||||||
default_panel: 'SilverStripe\CMS\Controllers\CMSPagesController'
|
default_panel: SilverStripe\CMS\Controllers\CMSPagesController
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
Name: cmscache
|
||||||
After:
|
After:
|
||||||
- '#corecache'
|
- '#corecache'
|
||||||
---
|
---
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
---
|
---
|
||||||
Name: cms-logging
|
Name: cms-logging
|
||||||
After: '#live-logging'
|
After:
|
||||||
Except:
|
- '#loggingformatters'
|
||||||
environment: dev
|
|
||||||
---
|
---
|
||||||
SilverStripe\Core\Injector\Injector:
|
SilverStripe\Core\Injector\Injector:
|
||||||
FriendlyErrorFormatter:
|
Monolog\Formatter\FormatterInterface.friendly:
|
||||||
class: SilverStripe\CMS\Logging\ErrorPageErrorFormatter
|
class: SilverStripe\CMS\Logging\ErrorPageErrorFormatter
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
---
|
||||||
|
Name: cmsextensions
|
||||||
|
---
|
||||||
SilverStripe\Admin\LeftAndMain:
|
SilverStripe\Admin\LeftAndMain:
|
||||||
extensions:
|
extensions:
|
||||||
- SilverStripe\CMS\Controllers\LeftAndMainPageIconsExtension
|
- SilverStripe\CMS\Controllers\LeftAndMainPageIconsExtension
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
Name: cmsinjector
|
|
||||||
---
|
|
||||||
SilverStripe\Core\Injector\Injector:
|
|
||||||
SiteTreeLinkTracking_Parser:
|
|
||||||
class: SilverStripe\CMS\Model\SiteTreeLinkTracking_Parser
|
|
@ -390,6 +390,6 @@ class ErrorPage extends Page
|
|||||||
*/
|
*/
|
||||||
protected static function get_asset_handler()
|
protected static function get_asset_handler()
|
||||||
{
|
{
|
||||||
return Injector::inst()->get('GeneratedAssetHandler');
|
return Injector::inst()->get(GeneratedAssetHandler::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ class SiteTreeLinkTracking extends DataExtension
|
|||||||
* @var array
|
* @var array
|
||||||
* @config
|
* @config
|
||||||
*/
|
*/
|
||||||
private static $dependencies = array(
|
private static $dependencies = [
|
||||||
'Parser' => '%$SiteTreeLinkTracking_Parser'
|
'Parser' => '%$' . SiteTreeLinkTracking_Parser::class
|
||||||
);
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parser for link tracking
|
* Parser for link tracking
|
||||||
@ -64,7 +64,7 @@ class SiteTreeLinkTracking extends DataExtension
|
|||||||
* @param SiteTreeLinkTracking_Parser $parser
|
* @param SiteTreeLinkTracking_Parser $parser
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setParser($parser)
|
public function setParser(SiteTreeLinkTracking_Parser $parser = null)
|
||||||
{
|
{
|
||||||
$this->parser = $parser;
|
$this->parser = $parser;
|
||||||
return $this;
|
return $this;
|
||||||
@ -81,7 +81,7 @@ class SiteTreeLinkTracking extends DataExtension
|
|||||||
);
|
);
|
||||||
|
|
||||||
private static $belongs_many_many = array(
|
private static $belongs_many_many = array(
|
||||||
"BackLinkTracking" => "SilverStripe\\CMS\\Model\\SiteTree.LinkTracking"
|
"BackLinkTracking" => SiteTree::class . '.LinkTracking',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +14,6 @@ use SilverStripe\Control\HTTPResponse_Exception;
|
|||||||
*/
|
*/
|
||||||
class ErrorPageTest extends FunctionalTest
|
class ErrorPageTest extends FunctionalTest
|
||||||
{
|
{
|
||||||
|
|
||||||
protected static $fixture_file = 'ErrorPageTest.yml';
|
protected static $fixture_file = 'ErrorPageTest.yml';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,8 +28,7 @@ class ErrorPageTest extends FunctionalTest
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
// Set temporary asset backend store
|
// Set temporary asset backend store
|
||||||
TestAssetStore::activate('ErrorPageTest');
|
TestAssetStore::activate('ErrorPageTest');
|
||||||
Config::inst()->update('SilverStripe\\CMS\\Model\\ErrorPage', 'enable_static_file', true);
|
Config::modify()->set(ErrorPage::class, 'enable_static_file', true);
|
||||||
Config::inst()->update('SilverStripe\\Control\\Director', 'environment_type', 'live');
|
|
||||||
$this->logInWithPermission('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +40,8 @@ class ErrorPageTest extends FunctionalTest
|
|||||||
|
|
||||||
public function test404ErrorPage()
|
public function test404ErrorPage()
|
||||||
{
|
{
|
||||||
$page = $this->objFromFixture('SilverStripe\\CMS\\Model\\ErrorPage', '404');
|
/** @var ErrorPage $page */
|
||||||
|
$page = $this->objFromFixture(ErrorPage::class, '404');
|
||||||
// ensure that the errorpage exists as a physical file
|
// ensure that the errorpage exists as a physical file
|
||||||
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
|
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
|
||||||
|
|
||||||
@ -60,7 +59,7 @@ class ErrorPageTest extends FunctionalTest
|
|||||||
|
|
||||||
public function testBehaviourOfShowInMenuAndShowInSearchFlags()
|
public function testBehaviourOfShowInMenuAndShowInSearchFlags()
|
||||||
{
|
{
|
||||||
$page = $this->objFromFixture('SilverStripe\\CMS\\Model\\ErrorPage', '404');
|
$page = $this->objFromFixture(ErrorPage::class, '404');
|
||||||
|
|
||||||
/* Don't show the error page in the menus */
|
/* Don't show the error page in the menus */
|
||||||
$this->assertEquals($page->ShowInMenus, 0, 'Don\'t show the error page in the menus');
|
$this->assertEquals($page->ShowInMenus, 0, 'Don\'t show the error page in the menus');
|
||||||
@ -71,7 +70,8 @@ class ErrorPageTest extends FunctionalTest
|
|||||||
|
|
||||||
public function testBehaviourOf403()
|
public function testBehaviourOf403()
|
||||||
{
|
{
|
||||||
$page = $this->objFromFixture('SilverStripe\\CMS\\Model\\ErrorPage', '403');
|
/** @var ErrorPage $page */
|
||||||
|
$page = $this->objFromFixture(ErrorPage::class, '403');
|
||||||
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
|
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -88,7 +88,8 @@ class ErrorPageTest extends FunctionalTest
|
|||||||
public function testSecurityError()
|
public function testSecurityError()
|
||||||
{
|
{
|
||||||
// Generate 404 page
|
// Generate 404 page
|
||||||
$page = $this->objFromFixture('SilverStripe\\CMS\\Model\\ErrorPage', '404');
|
/** @var ErrorPage $page */
|
||||||
|
$page = $this->objFromFixture(ErrorPage::class, '404');
|
||||||
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
|
$page->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE);
|
||||||
|
|
||||||
// Test invalid action
|
// Test invalid action
|
||||||
@ -101,7 +102,8 @@ class ErrorPageTest extends FunctionalTest
|
|||||||
public function testStaticCaching()
|
public function testStaticCaching()
|
||||||
{
|
{
|
||||||
// Test new error code does not have static content
|
// Test new error code does not have static content
|
||||||
$this->assertEmpty(ErrorPage::get_content_for_errorcode('401'));
|
$error = ErrorPage::get_content_for_errorcode('401');
|
||||||
|
$this->assertEmpty($error);
|
||||||
$expectedErrorPagePath = TestAssetStore::base_path() . '/error-401.html';
|
$expectedErrorPagePath = TestAssetStore::base_path() . '/error-401.html';
|
||||||
$this->assertFileNotExists($expectedErrorPagePath, 'Error page is not automatically cached');
|
$this->assertFileNotExists($expectedErrorPagePath, 'Error page is not automatically cached');
|
||||||
|
|
||||||
@ -124,7 +126,7 @@ class ErrorPageTest extends FunctionalTest
|
|||||||
*/
|
*/
|
||||||
public function testGeneratedFile()
|
public function testGeneratedFile()
|
||||||
{
|
{
|
||||||
Config::inst()->update('SilverStripe\\CMS\\Model\\ErrorPage', 'enable_static_file', false);
|
Config::modify()->set(ErrorPage::class, 'enable_static_file', false);
|
||||||
$this->logInWithPermission('ADMIN');
|
$this->logInWithPermission('ADMIN');
|
||||||
|
|
||||||
$page = new ErrorPage();
|
$page = new ErrorPage();
|
||||||
|
Loading…
Reference in New Issue
Block a user