tests: Remove @expectException annotation.

This commit is contained in:
Pol Dellaiera
2021-12-21 16:22:31 +01:00
parent f93b1935ee
commit 6a0ce72836
3 changed files with 18 additions and 22 deletions

View File

@@ -11,8 +11,11 @@ declare(strict_types=1);
namespace Chill\MainBundle\Test\Search;
use Chill\MainBundle\Search\ParsingException;
use Chill\MainBundle\Search\SearchInterface;
use Chill\MainBundle\Search\SearchProvider;
use Chill\MainBundle\Search\UnknowSearchDomainException;
use Chill\MainBundle\Search\UnknowSearchNameException;
use PHPUnit\Framework\TestCase;
/**
@@ -100,20 +103,18 @@ final class SearchProviderTest extends TestCase
], $terms);
}
/**
* @expectedException \Chill\MainBundle\Search\UnknowSearchNameException
*/
public function testInvalidSearchName()
{
$this->expectException(UnknowSearchNameException::class);
$this->search->getByName('invalid name');
}
/**
* @expectedException \Chill\MainBundle\Search\ParsingException
*/
public function testMultipleDomainError()
{
$term = $this->p('@person @report');
$this->expectException(ParsingException::class);
$this->p('@person @report');
}
/**
@@ -146,14 +147,11 @@ final class SearchProviderTest extends TestCase
], $response);
}
/**
* @expectedException \Chill\MainBundle\Search\UnknowSearchDomainException
*/
public function testSearchResultDomainUnknow()
{
$response = $this->search->getSearchResults('@unknow domain');
$this->expectException(UnknowSearchDomainException::class);
//$this->markTestSkipped();
$this->search->getSearchResults('@unknow domain');
}
public function testSearchWithinSpecificSearchName()
@@ -169,12 +167,11 @@ final class SearchProviderTest extends TestCase
$this->assertEquals('I am domain foo', $response);
}
/**
* @expectedException \Chill\MainBundle\Search\ParsingException
*/
public function testSearchWithinSpecificSearchNameInConflictWithSupport()
{
$response = $this->search->getResultByName('@foo default search', 'bar');
$this->expectException(ParsingException::class);
$this->search->getResultByName('@foo default search', 'bar');
}
public function testSimplePattern()

View File

@@ -55,11 +55,10 @@ final class TokenManagerTest extends KernelTestCase
$this->assertEquals($user->getUsernameCanonical(), $tokens['u']);
}
/**
* @expectedException \UnexpectedValueException
*/
public function testGenerateEmptyUsernameCanonical()
{
$this->expectException(\UnexpectedValueException::class);
$tokenManager = $this->tokenManager;
// set a username, but not a username canonical
$user = (new User())->setUsername('test');