I want to test my application behavior using Selenium. But I want the Yii::$app
component behavior can be mocked from the test runner?
Let's say I have a class
Foo extends \yii\base\Component {
public function bar() {
//return something
}
}
And in the configuration I attach as Yii::$app
component as Yii::$app->foo
.
[
'foo' => [
'class' => 'Foo',
]
]
So the acceptance test works by running a web server and the test runner will run Selenium against the web server.
In the test runner I want to mock the Yii::$app->foo->bar()
method so that it will return some string.
How should I do this mock the application component in the application run by the web server from the test runner?
Aucun commentaire:
Enregistrer un commentaire