Composer lint

This commit is contained in:
Will Rossiter 2017-09-14 09:41:11 +12:00
parent 82c139e30a
commit 0c964d1ed8
4 changed files with 17 additions and 6 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.sass-cache
/.php_cs.cache

View File

@ -16,13 +16,17 @@
"silverstripe/cms": "The SilverStripe Content Management System"
},
"require-dev": {
"phpunit/PHPUnit": "~4.8"
"phpunit/PHPUnit": "^5.7"
},
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"scripts": {
"lint": "phpcs src/ tests/",
"fix": "php-cs-fixer fix src/ && php-cs-fixer fix tests/"
},
"autoload": {
"psr-4": {
"SilverStripe\\Comments\\": "src/",

View File

@ -19,7 +19,6 @@ use SilverStripe\Security\Security;
*/
class CommentAdmin extends LeftAndMain implements PermissionProvider
{
private static $url_segment = 'comments';
private static $url_rule = '/$Action';
@ -97,13 +96,19 @@ class CommentAdmin extends LeftAndMain implements PermissionProvider
$fields = new FieldList(
$root = new TabSet(
'Root',
new Tab('NewComments', _t('CommentAdmin.NewComments', 'New') . ' ' . $newCount,
new Tab(
'NewComments',
_t('CommentAdmin.NewComments', 'New') . ' ' . $newCount,
$newGrid
),
new Tab('ApprovedComments', _t('CommentAdmin.ApprovedComments', 'Approved') . ' ' . $approvedCount,
new Tab(
'ApprovedComments',
_t('CommentAdmin.ApprovedComments', 'Approved') . ' ' . $approvedCount,
$approvedGrid
),
new Tab('SpamComments', _t('CommentAdmin.SpamComments', 'Spam') . ' ' . $spamCount,
new Tab(
'SpamComments',
_t('CommentAdmin.SpamComments', 'Spam') . ' ' . $spamCount,
$spamGrid
)
)

View File

@ -143,7 +143,8 @@ class CommentingControllerTest extends FunctionalTest
// comments sitewide
$response = $this->get('comments/rss');
$this->assertEquals(10, substr_count($response->getBody(), "<item>"), "10 approved, non spam comments on page 1");
$comment = "10 approved, non spam comments on page 1";
$this->assertEquals(10, substr_count($response->getBody(), "<item>"), $comment);
$response = $this->get('comments/rss?start=10');
$this->assertEquals(4, substr_count($response->getBody(), "<item>"), "3 approved, non spam comments on page 2");