1
0
Fork 0
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:
vatseek 2012-12-20 16:20:24 +02:00
parent 7db26689cf
commit 823cbfbb1f

View file

@ -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);
}
}