Browse Source

Fix tests and regression in @ref script handling

Jordi Boggiano 8 years ago
parent
commit
98c5f825e0

+ 1 - 1
src/Composer/EventDispatcher/EventDispatcher.php

@@ -469,7 +469,7 @@ class EventDispatcher
      */
     protected function isComposerScript($callable)
     {
-        return '@composer ' === substr($callable, 0, 10);
+        return '@' === substr($callable, 0, 1) && '@php ' !== substr($callable, 0, 5);
     }
 
     /**

+ 2 - 2
tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php

@@ -122,8 +122,8 @@ class PerforceDriverTest extends TestCase
 
     public function testInitializeLogsInAndConnectsClient()
     {
-        $this->perforce->expects($this->at(0))->method('p4Login')->with($this->identicalTo($this->io));
-        $this->perforce->expects($this->at(1))->method('checkStream')->with($this->equalTo(self::TEST_DEPOT));
+        $this->perforce->expects($this->at(0))->method('p4Login');
+        $this->perforce->expects($this->at(1))->method('checkStream');
         $this->perforce->expects($this->at(2))->method('writeP4ClientSpec');
         $this->perforce->expects($this->at(3))->method('connectClient');
         $this->driver->initialize();