mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-03 06:55:03 +03:00
add file insert method to base context
This commit is contained in:
parent
7db26689cf
commit
823cbfbb1f
|
@ -233,4 +233,19 @@ class BaseFeatureContext extends BehatContext
|
|||
$oUser->setRating((int)$carmaPoints);
|
||||
$this->getEngine()->User_Update($oUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^I put the file "([^"]*)" to "([^"]*)" for plugin "([^"]*)"$/
|
||||
*/
|
||||
public function iPutTheFileTo($fileName, $path, $plugin)
|
||||
{
|
||||
if ($plugin != 'main') {
|
||||
$fixturePath = realpath((dirname(__FILE__)) . "/../../../../plugins/{$plugin}/tests/fixtures/");
|
||||
}
|
||||
else {
|
||||
$fixturePath = realpath((dirname(__FILE__)) . "/../../../../tests/fixtures/");
|
||||
}
|
||||
|
||||
$this->getMinkContext()->attachFileToField($path, $fixturePath . $fileName);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue