Use correct field names when mocking plugin information in a test

[MAILPOET-2635]
This commit is contained in:
Jan Jakeš
2020-01-15 13:52:44 +01:00
committed by Jack Kitterhing
parent fe6a383f36
commit d955a9105a

View File

@@ -43,19 +43,19 @@ class InstallerTest extends \MailPoetTest {
'retrievePluginInformation' => function () { 'retrievePluginInformation' => function () {
$obj = new \stdClass(); $obj = new \stdClass();
$obj->slug = $this->slug; $obj->slug = $this->slug;
$obj->pluginName = 'MailPoet Premium'; $obj->name = 'MailPoet Premium';
$obj->newVersion = '3.0.0-alpha.0.0.3.1'; $obj->new_version = '3.0.0-alpha.0.0.3.1'; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
$obj->requires = '4.6'; $obj->requires = '4.6';
$obj->tested = '4.7.4'; $obj->tested = '4.7.4';
$obj->downloaded = 12540; $obj->downloaded = 12540;
$obj->lastUpdated = date('Y-m-d'); $obj->last_updated = date('Y-m-d'); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
$obj->sections = [ $obj->sections = [
'description' => 'The new version of the Premium plugin', 'description' => 'The new version of the Premium plugin',
'another_section' => 'This is another section', 'another_section' => 'This is another section',
'changelog' => 'Some new features', 'changelog' => 'Some new features',
]; ];
$obj->downloadLink = home_url() . '/wp-content/uploads/mailpoet-premium.zip'; $obj->download_link = home_url() . '/wp-content/uploads/mailpoet-premium.zip'; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
$obj->package = $obj->downloadLink; $obj->package = $obj->download_link; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
return $obj; return $obj;
}, },
], ],
@@ -63,8 +63,8 @@ class InstallerTest extends \MailPoetTest {
); );
$result = $installer->getPluginInformation(false, 'plugin_information', $args); $result = $installer->getPluginInformation(false, 'plugin_information', $args);
expect($result->slug)->equals($this->slug); expect($result->slug)->equals($this->slug);
expect($result->newVersion)->notEmpty(); expect($result->new_version)->notEmpty(); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
expect($result->downloadLink)->notEmpty(); expect($result->download_link)->notEmpty(); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
expect($result->package)->notEmpty(); expect($result->package)->notEmpty();
} }