But then you should call $test instead of $this

----- Reply message -----
Von: "dantleech" <notifications@github.com>
An: "phpcr/phpcr-utils" <phpcr-utils@noreply.github.com>
Cc: "David Buchmann" <david@liip.ch>
Betreff: [phpcr-utils] [WIP] Refactored node dump command, added Node* command tests (#64)
Datum: So., Mai. 5, 2013 16:03
In tests/PHPCR/Tests/Util/Console/Command/NodeTouchCommandTest.php: 
> +    public function setUp() 
> +    { 
> +        parent::setUp(); 
> +        $this->application->add(new NodeTouchCommand()); 
> +        $this->nodeType = $this->getMock('PHPCR\NodeType\NodeTypeInterface'); 
> +    } 
> + 
> +    public function testTouch() 
> +    { 
> +        $test = $this; 
> +        $this->session->expects($this->exactly(2)) 
> +            ->method('getNode') 
> +            ->will($this->returnCallback(function ($path) use ($test) { 
> +                switch ($path) { 
> +                    case '/': 
> +                        return $this->node1; 

Yeah, I think this is a PHP compatibility problem, I'm pretty sure you can;y pass in $this anyway, hence why I assign it to $test. Needs a little refactoring ... 

&mdash;
Reply to this email directly or view it on GitHub.