upgraded to phpunit 8 (#1155)

This commit is contained in:
Kevin Papst
2019-10-24 17:35:05 +02:00
committed by GitHub
parent e91e4ff430
commit b0f83291ee
81 changed files with 421 additions and 463 deletions

View File

@@ -13,18 +13,18 @@ use App\Entity\User;
use App\Ldap\LdapManager;
use App\Ldap\LdapUserProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
/**
* @covers \App\Ldap\LdapUserProvider
*/
class LdapUserProviderTest extends TestCase
{
/**
* @expectedException \Symfony\Component\Security\Core\Exception\UsernameNotFoundException
* @expectedExceptionMessage User "test" not found
*/
public function testLoadUserByUsernameReturnsNull()
{
$this->expectException(UsernameNotFoundException::class);
$this->expectExceptionMessage('User "test" not found');
$manager = $this->getMockBuilder(LdapManager::class)->disableOriginalConstructor()->setMethods(['findUserByUsername'])->getMock();
$manager->expects($this->once())->method('findUserByUsername')->willReturn(null);