tests/unit/Subjects/FilesystemTraitTest.php
/**
     * Test the resolvePath() method with an absolute path.
     *
     * @return void
     */
Test the resolvePath() method with an absolute path.
@return void
Test the resolvePath () method with an absolute path . @return void
public function testResolvePathWithAbsolutePath()
    {
        $mockFilesystem = $this->getMockBuilder('TechDivision\Import\Adapter\FilesystemAdapterInterface')
                               ->setMethods(get_class_methods('TechDivision\Import\Adapter\FilesystemAdapterInterface'))
                               ->getMock();
        $mockFilesystem->expects($this->exactly(2))
                       ->method('isDir')
                       ->withConsecutive(
                           array($path0 = '/var/www/html/test.txt'),
                           array($path1 = getcwd() . DIRECTORY_SEPARATOR . ltrim($path0, '/'))
                       )
                       ->willReturnOnConsecutiveCalls(false, true);
        $this->filesystemTrait->setFilesystemAdapter($mockFilesystem);
        $this->assertSame($path1, $this->filesystemTrait->resolvePath($path0));
    }
public function testResolvePathWithAbsolutePath ( ) { $ mockFilesystem = $ this -> getMockBuilder ( 'TechDivision\Import\Adapter\FilesystemAdapterInterface' ) -> setMethods ( get_class_methods ( 'TechDivision\Import\Adapter\FilesystemAdapterInterface' ) ) -> getMock ( ) ; $ mockFilesystem -> expects ( $ this -> exactly ( 2 ) ) -> method ( 'isDir' ) -> withConsecutive ( array ( $ path0 = '/var/www/html/test.txt' ) , array ( $ path1 = getcwd ( ) . DIRECTORY_SEPARATOR . ltrim ( $ path0 , '/' ) ) ) -> willReturnOnConsecutiveCalls ( false , true ) ; $ this -> filesystemTrait -> setFilesystemAdapter ( $ mockFilesystem ) ; $ this -> assertSame ( $ path1 , $ this -> filesystemTrait -> resolvePath ( $ path0 ) ) ; }
Test the resolvePath() method with an absolute path.
Test the resolvePath () method with an absolute path .
// mock the filesystem // set the mock filesystem // query whether or not the path will be resolved