it("expects overrided method to not be called on method's __CLASS__", function () {
$bar = new SubBar();
expect('Kahlan\\Spec\\Fixture\\Plugin\\Pointcut\\Bar')->not->toReceive('overrided');
expect('Kahlan\\Spec\\Fixture\\Plugin\\Pointcut\\SubBar')->toReceive('overrided');
$bar->overrided();
});
});
});
context("with static call", function () {
it("expects called method to be called", function () {
expect('Kahlan\\Spec\\Fixture\\Plugin\\Pointcut\\Foo')->toReceive('::version');
Foo::version();
});
it("expects called method to not be dynamically called", function () {
expect('Kahlan\\Spec\\Fixture\\Plugin\\Pointcut\\Foo')->not->toReceive('version');
Foo::version();
});
it("expects called method on instance to be called on classname", function () {
$foo = new Foo();
expect('Kahlan\\Spec\\Fixture\\Plugin\\Pointcut\\Foo')->toReceive('::version');
$foo::version();
});
it("expects called method on instance to not be dynamically called", function () {
$foo = new Foo();
expect('Kahlan\\Spec\\Fixture\\Plugin\\Pointcut\\Foo')->not->toReceive('version');
$foo::version();
});
it("expects called method on instance to be called on classname (alternative syntax)", function () {
$foo = new Foo();
expect($foo)->toReceive('::version');
$foo::version();