1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00

Add void types where no return statement is present

This commit is contained in:
Jordi Boggiano 2022-02-18 10:38:54 +01:00
parent 32852304d0
commit abdc6893a6
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
213 changed files with 1129 additions and 1130 deletions

View file

@ -20,44 +20,44 @@ use Composer\Test\TestCase;
*/
class TarTest extends TestCase
{
public function testReturnsNullifTheTarIsNotFound()
public function testReturnsNullifTheTarIsNotFound(): void
{
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/invalid.zip');
$this->assertNull($result);
}
public function testReturnsNullIfTheTarIsEmpty()
public function testReturnsNullIfTheTarIsEmpty(): void
{
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/empty.tar.gz');
$this->assertNull($result);
}
public function testThrowsExceptionIfTheTarHasNoComposerJson()
public function testThrowsExceptionIfTheTarHasNoComposerJson(): void
{
self::expectException('RuntimeException');
Tar::getComposerJson(__DIR__.'/Fixtures/Tar/nojson.tar.gz');
}
public function testThrowsExceptionIfTheComposerJsonIsInASubSubfolder()
public function testThrowsExceptionIfTheComposerJsonIsInASubSubfolder(): void
{
self::expectException('RuntimeException');
Tar::getComposerJson(__DIR__.'/Fixtures/Tar/subfolders.tar.gz');
}
public function testReturnsComposerJsonInTarRoot()
public function testReturnsComposerJsonInTarRoot(): void
{
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/root.tar.gz');
$this->assertEquals("{\n \"name\": \"foo/bar\"\n}\n", $result);
}
public function testReturnsComposerJsonInFirstFolder()
public function testReturnsComposerJsonInFirstFolder(): void
{
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/folder.tar.gz');
$this->assertEquals("{\n \"name\": \"foo/bar\"\n}\n", $result);
}
public function testMultipleTopLevelDirsIsInvalid()
public function testMultipleTopLevelDirsIsInvalid(): void
{
self::expectException('RuntimeException');
Tar::getComposerJson(__DIR__.'/Fixtures/Tar/multiple.tar.gz');