mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Composer lint
This commit is contained in:
parent
82c139e30a
commit
0c964d1ed8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.sass-cache
|
||||
/.php_cs.cache
|
||||
|
@ -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/",
|
||||
|
@ -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
|
||||
)
|
||||
)
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user