/** * @dataProvider provideUserExists * @param bool $primary1Exists * @param bool $primary2Exists * @param bool $expect */ public function testUserExists($primary1Exists, $primary2Exists, $expect) { $mock1 = $this->getMockForAbstractClass(PrimaryAuthenticationProvider::class); $mock1->expects($this->any())->method('getUniqueId')->will($this->returnValue('primary1')); $mock1->expects($this->any())->method('testUserExists')->with($this->equalTo('UTSysop'))->will($this->returnValue($primary1Exists)); $mock2 = $this->getMockForAbstractClass(PrimaryAuthenticationProvider::class); $mock2->expects($this->any())->method('getUniqueId')->will($this->returnValue('primary2')); $mock2->expects($this->any())->method('testUserExists')->with($this->equalTo('UTSysop'))->will($this->returnValue($primary2Exists)); $this->primaryauthMocks = [$mock1, $mock2]; $this->initializeManager(true); $this->assertSame($expect, $this->manager->userExists('UTSysop')); }