Add public keyword to methods
[MAILPOET-2413]
This commit is contained in:
@ -15,7 +15,7 @@ class LoaderTest extends \MailPoetTest {
|
||||
/** @var Loader */
|
||||
private $loader;
|
||||
|
||||
function _before() {
|
||||
public function _before() {
|
||||
$this->loader = new Loader(new DBMapper());
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegment::$_table);
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegmentFilter::$_table);
|
||||
@ -43,14 +43,14 @@ class LoaderTest extends \MailPoetTest {
|
||||
$filter_data->save();
|
||||
}
|
||||
|
||||
function testItLoadsSegments() {
|
||||
public function testItLoadsSegments() {
|
||||
$data = $this->loader->load();
|
||||
expect($data)->count(2);
|
||||
expect($data[0])->isInstanceOf('\MailPoet\Models\DynamicSegment');
|
||||
expect($data[1])->isInstanceOf('\MailPoet\Models\DynamicSegment');
|
||||
}
|
||||
|
||||
function testItDoesNotLoadTrashedSegments() {
|
||||
public function testItDoesNotLoadTrashedSegments() {
|
||||
$this->segments[0]->trash();
|
||||
$data = $this->loader->load();
|
||||
expect($data)->count(1);
|
||||
@ -58,7 +58,7 @@ class LoaderTest extends \MailPoetTest {
|
||||
expect($data[0]->name)->equals('segment 2');
|
||||
}
|
||||
|
||||
function testItPopulatesCommonData() {
|
||||
public function testItPopulatesCommonData() {
|
||||
$data = $this->loader->load();
|
||||
expect($data[0]->name)->equals('segment 1');
|
||||
expect($data[1]->name)->equals('segment 2');
|
||||
@ -66,7 +66,7 @@ class LoaderTest extends \MailPoetTest {
|
||||
expect($data[1]->description)->equals('description');
|
||||
}
|
||||
|
||||
function testItPopulatesFilters() {
|
||||
public function testItPopulatesFilters() {
|
||||
$data = $this->loader->load();
|
||||
$filters0 = $data[0]->getFilters();
|
||||
$filters1 = $data[1]->getFilters();
|
||||
@ -78,7 +78,7 @@ class LoaderTest extends \MailPoetTest {
|
||||
expect($filters1[0]->getRole())->equals('Administrator');
|
||||
}
|
||||
|
||||
function _after() {
|
||||
public function _after() {
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegment::$_table);
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegmentFilter::$_table);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class SingleSegmentLoaderTest extends \MailPoetTest {
|
||||
/** @var SingleSegmentLoader */
|
||||
private $loader;
|
||||
|
||||
function _before() {
|
||||
public function _before() {
|
||||
$this->loader = new SingleSegmentLoader(new DBMapper());
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegment::$_table);
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegmentFilter::$_table);
|
||||
@ -32,23 +32,23 @@ class SingleSegmentLoaderTest extends \MailPoetTest {
|
||||
$filter_data->save();
|
||||
}
|
||||
|
||||
function testItLoadsSegments() {
|
||||
public function testItLoadsSegments() {
|
||||
$data = $this->loader->load($this->segment->id);
|
||||
expect($data)->isInstanceOf('\MailPoet\Models\DynamicSegment');
|
||||
}
|
||||
|
||||
function testItThrowsForUnknownSegment() {
|
||||
public function testItThrowsForUnknownSegment() {
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
$this->loader->load($this->segment->id + 11564564);
|
||||
}
|
||||
|
||||
function testItPopulatesCommonData() {
|
||||
public function testItPopulatesCommonData() {
|
||||
$data = $this->loader->load($this->segment->id);
|
||||
expect($data->name)->equals('segment 1');
|
||||
expect($data->description)->equals('description');
|
||||
}
|
||||
|
||||
function testItPopulatesFilters() {
|
||||
public function testItPopulatesFilters() {
|
||||
$data = $this->loader->load($this->segment->id);
|
||||
$filters0 = $data->getFilters();
|
||||
expect($filters0)->count(1);
|
||||
@ -56,7 +56,7 @@ class SingleSegmentLoaderTest extends \MailPoetTest {
|
||||
expect($filters0[0]->getRole())->equals('Administrator');
|
||||
}
|
||||
|
||||
function _after() {
|
||||
public function _after() {
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegment::$_table);
|
||||
ORM::raw_execute('TRUNCATE ' . DynamicSegmentFilter::$_table);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class SubscribersCountTest extends \MailPoetTest {
|
||||
/** @var RequirementsChecker|\PHPUnit_Framework_MockObject_MockObject */
|
||||
private $requirement_checker;
|
||||
|
||||
function _before() {
|
||||
public function _before() {
|
||||
$this->cleanData();
|
||||
wp_insert_user([
|
||||
'user_login' => 'user-role-test1',
|
||||
@ -39,7 +39,7 @@ class SubscribersCountTest extends \MailPoetTest {
|
||||
->getMock();
|
||||
}
|
||||
|
||||
function testItConstructsQuery() {
|
||||
public function testItConstructsQuery() {
|
||||
$this->requirement_checker->method('shouldSkipSegment')->willReturn(false);
|
||||
$userRole = DynamicSegment::create();
|
||||
$userRole->hydrate([
|
||||
@ -53,7 +53,7 @@ class SubscribersCountTest extends \MailPoetTest {
|
||||
expect($count)->equals(2);
|
||||
}
|
||||
|
||||
function testItSkipsIfRequirementNotMet() {
|
||||
public function testItSkipsIfRequirementNotMet() {
|
||||
$this->requirement_checker->method('shouldSkipSegment')->willReturn(true);
|
||||
$userRole = DynamicSegment::create();
|
||||
$userRole->hydrate([
|
||||
@ -67,7 +67,7 @@ class SubscribersCountTest extends \MailPoetTest {
|
||||
expect($count)->equals(0);
|
||||
}
|
||||
|
||||
function _after() {
|
||||
public function _after() {
|
||||
$this->cleanData();
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class SubscribersIdsTest extends \MailPoetTest {
|
||||
/** @var RequirementsChecker|\PHPUnit_Framework_MockObject_MockObject */
|
||||
private $requirement_checker;
|
||||
|
||||
function _before() {
|
||||
public function _before() {
|
||||
$this->cleanData();
|
||||
$this->editors_wp_ids[] = wp_insert_user([
|
||||
'user_login' => 'user-role-test1',
|
||||
@ -42,7 +42,7 @@ class SubscribersIdsTest extends \MailPoetTest {
|
||||
->getMock();
|
||||
}
|
||||
|
||||
function testItConstructsSubscribersIdQueryForAnyDynamicSegment() {
|
||||
public function testItConstructsSubscribersIdQueryForAnyDynamicSegment() {
|
||||
$this->requirement_checker->method('shouldSkipSegment')->willReturn(false);
|
||||
$userRole = DynamicSegment::create();
|
||||
$userRole->hydrate([
|
||||
@ -59,7 +59,7 @@ class SubscribersIdsTest extends \MailPoetTest {
|
||||
$this->assertEquals($wp_ids, $this->editors_wp_ids, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = true);
|
||||
}
|
||||
|
||||
function testItSkipsConstructingSubscribersIdQueryForAnyDynamicSegmentIfRequirementsNotMet() {
|
||||
public function testItSkipsConstructingSubscribersIdQueryForAnyDynamicSegmentIfRequirementsNotMet() {
|
||||
$this->requirement_checker->method('shouldSkipSegment')->willReturn(true);
|
||||
$userRole = DynamicSegment::create();
|
||||
$userRole->hydrate([
|
||||
@ -72,7 +72,7 @@ class SubscribersIdsTest extends \MailPoetTest {
|
||||
expect($result)->isEmpty();
|
||||
}
|
||||
|
||||
function _after() {
|
||||
public function _after() {
|
||||
$this->cleanData();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user