Add missing this for stubs expecting a number of method calls to work

This commit is contained in:
stoletniy
2017-06-21 19:14:17 +03:00
committed by pavel-mailpoet
parent 0e5401dd68
commit 6ff3895940
5 changed files with 27 additions and 14 deletions

View File

@@ -18,7 +18,8 @@ class InstallerTest extends MailPoetTest {
$this->installer,
array(
'getPluginInformation' => Stub::once()
)
),
$this
);
$installer->init();
apply_filters('plugins_api', null, null, null);
@@ -51,7 +52,8 @@ class InstallerTest extends MailPoetTest {
$obj->package = $obj->download_link;
return $obj;
}
)
),
$this
);
$result = $installer->getPluginInformation(false, 'plugin_information', $args);
expect($result->slug)->equals($this->slug);

View File

@@ -50,7 +50,8 @@ class RendererTest extends MailPoetTest {
'renderer' => Stub::makeEmpty('Twig_Environment',
array(
'render' => Stub::atLeastOnce(function() { return 'test render'; }),
)
),
$this
),
)
);
@@ -69,7 +70,8 @@ class RendererTest extends MailPoetTest {
'render' => Stub::atLeastOnce(function() use ($exception_message) {
throw new \RuntimeException($exception_message);
}),
)
),
$this
),
)
);

View File

@@ -21,7 +21,8 @@ class UpdaterTest extends MailPoetTest {
$this->updater,
array(
'checkForUpdate' => Stub::once()
)
),
$this
);
$updater->init();
apply_filters('pre_set_site_transient_update_plugins', null);
@@ -48,7 +49,8 @@ class UpdaterTest extends MailPoetTest {
'package' => home_url() . '/wp-content/uploads/mailpoet-premium.zip'
);
}
)
),
$this
);
$result = $updater->checkForUpdate($update_transient);
expect($result->last_checked)->greaterOrEquals($update_transient->last_checked);