From 8db937256bdd1feca336f1fbea3b86b37d00c9eb Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 19 Jul 2019 23:36:06 +0100 Subject: [PATCH] resourceloader: Complete test coverage for FilePath The 'getLocalBasePath' and 'getRemoteBasePath' methods were not yet covered. Change-Id: If2eacca3a908048ec62b357e14e4e2322363e296 --- .../ResourceLoaderFilePathTest.php | 56 +++++-------------- 1 file changed, 13 insertions(+), 43 deletions(-) diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderFilePathTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderFilePathTest.php index 292340bcf2..1249ca593c 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderFilePathTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderFilePathTest.php @@ -1,53 +1,23 @@ 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' - ); + public function testConstructor() { + $path = new ResourceLoaderFilePath( 'dummy/path', '/local', '/remote' ); - $this->assertSame( - 'remoteBasePath/dummy/path', $resourceLoaderFilePath->getRemotePath() - ); + $this->assertInstanceOf( ResourceLoaderFilePath::class, $path ); } - /** - * @covers ResourceLoaderFilePath::getPath - */ - public function testGetPath() { - $resourceLoaderFilePath = new ResourceLoaderFilePath( - 'dummy/path', 'localBasePath', 'remoteBasePath' - ); + public function testGetters() { + $path = new ResourceLoaderFilePath( 'dummy/path', '/local', '/remote' ); - $this->assertSame( - 'dummy/path', $resourceLoaderFilePath->getPath() - ); + $this->assertSame( '/local/dummy/path', $path->getLocalPath() ); + $this->assertSame( '/remote/dummy/path', $path->getRemotePath() ); + $this->assertSame( '/local', $path->getLocalBasePath() ); + $this->assertSame( '/remote', $path->getRemoteBasePath() ); + $this->assertSame( 'dummy/path', $path->getPath() ); } } -- 2.20.1