I'm using this is my custom testcase in magento test automation framework.
public function test_WithInvalidPassword($wrongPasswords, $errorMessage) {
//Data
$userData = $this->loadData('generic_admin_user', $wrongPasswords, array('email', 'user_name'));
//Steps
$this->adminUserHelper()->createAdminUser($userData);
//Verifying
$this->assertTrue($this->errorMessage($errorMessage), $this->messages);
$this->assertTrue($this->verifyMessagesCount(), $this->messages);
}
public function data_invalidPassword()
{
return array(
array(array(
'password' => '1234567890',
'password_confirmation' => '1234567890',
), 'invalid_password')
);
}
Here, it showing me the error like "SystemStores_CreateTest::test_WithInvalidPassword() Missing argument 1 for SystemStores_CreateTest::test_WithInvalidPassword()" and the same functionality is working in the default mtaf-testcases.
can any one suggest for it.
You need to set up a data provider to supply the values for the arguments.
You would need to add the @dataProvider annotation to the docblock comment for the test function.
You can find more information on this page: ecomdev.org/2011/02/01/phpunit-and-magento-yes-you-can.html under the heading 'Data Providers'.
There's also some information in the PHPUnit manual at: http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With