/** * @test */ public function should_move_method_between_callers() { $foo = new Foo(); $foo->beInvisible = function () { return 'Im invisible!'; }; $bar = new Bar(); $this->assertFalse(Helper::dynamic_method_exists('beInvisible', $bar)); $foo->move($foo->beInvisible, $bar); $this->assertTrue(Helper::dynamic_method_exists('beInvisible', $bar)); $this->assertFalse(Helper::dynamic_method_exists('beInvisible', $foo)); }