forked from KnpLabs/KnpUserBundle
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathUserManagerNoneTest.php
More file actions
50 lines (42 loc) · 1.57 KB
/
UserManagerNoneTest.php
File metadata and controls
50 lines (42 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\UserBundle\Tests\Model;
use FOS\UserBundle\Model\UserManagerNone;
use PHPUnit\Framework\TestCase;
class UserManagerNoneTest extends TestCase
{
/**
* @dataProvider methodsProvider
* @expectedException \RuntimeException
*/
public function testMethods($name, $arguments)
{
/** @var \FOS\UserBundle\Util\PasswordUpdaterInterface $passwordUpdater */
$passwordUpdater = $this->getMockBuilder('FOS\UserBundle\Util\PasswordUpdaterInterface')->getMock();
/** @var \FOS\UserBundle\Util\CanonicalFieldsUpdater $fieldsUpdater */
$fieldsUpdater = $this->getMockBuilder('FOS\UserBundle\Util\CanonicalFieldsUpdater')
->disableOriginalConstructor()
->getMock();
$manager = new UserManagerNone($passwordUpdater, $fieldsUpdater);
call_user_func_array(array($manager, $name), $arguments);
}
public function methodsProvider()
{
$user = $this->getMockBuilder('FOS\UserBundle\Model\UserInterface')->getMock();
return array(
array('deleteUser', array($user)),
array('findUserBy', array(array('id' => 1))),
array('findUsers', array()),
array('getClass', array()),
array('reloadUser', array($user)),
array('updateUser', array($user)),
);
}
}