wiki.techinc.nl/tests/phpunit/includes/resourceloader/ResourceLoaderFilePathTest.php
Derick Alangi a53e5171cf resourceloader: Add unit tests for ResourceLoaderFilePath class methods
~ 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
2019-07-15 22:05:37 +01:00

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()
);
}
}