Skip to content

Commit

Permalink
[Tests] Move expectException closer to the place of the expectation t…
Browse files Browse the repository at this point in the history
…o avoid false positives
  • Loading branch information
OskarStark committed Oct 31, 2023
1 parent af6cf42 commit c1108eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Tests/PackagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ public function testGetUrl()
public function testNoDefaultPackage()
{
$this->expectException(LogicException::class);
$packages = new Packages();
$packages->getPackage();
(new Packages())->getPackage();
}

public function testUndefinedPackage()
{
$this->expectException(InvalidArgumentException::class);
$packages = new Packages();
$packages->getPackage('a');
(new Packages())->getPackage('a');
}
}
2 changes: 1 addition & 1 deletion Tests/UrlPackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function testNoBaseUrls()
/**
* @dataProvider getWrongBaseUrlConfig
*/
public function testWrongBaseUrl($baseUrls)
public function testWrongBaseUrl(string $baseUrls)
{
$this->expectException(InvalidArgumentException::class);
new UrlPackage($baseUrls, new EmptyVersionStrategy());
Expand Down

0 comments on commit c1108eb

Please sign in to comment.