~ testConstructor() - unit test for the constructor method. ~ testGetLocalPath() - unit test for the getLocalPath() method. ~ testGetRemotePath() - unit test for the getRemotePath() method. ~ testGetPath() - unit test for the getPath() method. Change-Id: I0610938dd864931da7a7e1150ddb4d86ab9a2c5e
53 lines
1.3 KiB
PHP
53 lines
1.3 KiB
PHP
<?php
|
|
|
|
class ResourceLoaderFilePathTest extends PHPUnit\Framework\TestCase {
|
|
/**
|
|
* @covers ResourceLoaderFilePath::__construct
|
|
*/
|
|
public function testConstructor() {
|
|
$resourceLoaderFilePath = new ResourceLoaderFilePath(
|
|
'dummy/path', 'localBasePath', 'remoteBasePath'
|
|
);
|
|
|
|
$this->assertInstanceOf( ResourceLoaderFilePath::class, $resourceLoaderFilePath );
|
|
}
|
|
|
|
/**
|
|
* @covers ResourceLoaderFilePath::getLocalPath
|
|
*/
|
|
public function testGetLocalPath() {
|
|
$resourceLoaderFilePath = new ResourceLoaderFilePath(
|
|
'dummy/path', 'localBasePath', 'remoteBasePath'
|
|
);
|
|
|
|
$this->assertSame(
|
|
'localBasePath/dummy/path', $resourceLoaderFilePath->getLocalPath()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @covers ResourceLoaderFilePath::getRemotePath
|
|
*/
|
|
public function testGetRemotePath() {
|
|
$resourceLoaderFilePath = new ResourceLoaderFilePath(
|
|
'dummy/path', 'localBasePath', 'remoteBasePath'
|
|
);
|
|
|
|
$this->assertSame(
|
|
'remoteBasePath/dummy/path', $resourceLoaderFilePath->getRemotePath()
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @covers ResourceLoaderFilePath::getPath
|
|
*/
|
|
public function testGetPath() {
|
|
$resourceLoaderFilePath = new ResourceLoaderFilePath(
|
|
'dummy/path', 'localBasePath', 'remoteBasePath'
|
|
);
|
|
|
|
$this->assertSame(
|
|
'dummy/path', $resourceLoaderFilePath->getPath()
|
|
);
|
|
}
|
|
}
|