9
9
use Magento \Backend \Model \Auth as AuthModel ;
10
10
use Magento \Framework \Exception \AuthenticationException ;
11
11
use Magento \Framework \Exception \LocalizedException ;
12
+ use Magento \Framework \ObjectManagerInterface ;
12
13
use Magento \TestFramework \Fixture \DataFixture ;
14
+ use Magento \TestFramework \Fixture \DataFixtureStorage ;
13
15
use Magento \TestFramework \Fixture \DataFixtureStorageManager ;
14
16
use Magento \TestFramework \Helper \Bootstrap ;
15
17
use Magento \User \Model \User as UserModel ;
22
24
class ValidateUserDateFieldsTest extends TestCase
23
25
{
24
26
27
+ /**
28
+ * @var ObjectManagerInterface
29
+ */
30
+ private $ objectManager ;
31
+
32
+ /**
33
+ * @var DataFixtureStorage
34
+ */
35
+ private $ fixtures ;
36
+
25
37
/**
26
38
* @var AuthModel
27
39
*/
@@ -38,9 +50,10 @@ class ValidateUserDateFieldsTest extends TestCase
38
50
protected function setUp (): void
39
51
{
40
52
Bootstrap::getInstance ()->loadArea (\Magento \Backend \App \Area \FrontNameResolver::AREA_CODE );
41
- $ objectManager = Bootstrap::getObjectManager ();
42
- $ this ->authModel = $ objectManager ->create (AuthModel::class);
43
- $ this ->userModel = $ objectManager ->create (UserModel::class);
53
+ $ this ->objectManager = Bootstrap::getObjectManager ();
54
+ $ this ->fixtures = DataFixtureStorageManager::getStorage ();
55
+ $ this ->authModel = $ this ->objectManager ->create (AuthModel::class);
56
+ $ this ->userModel = $ this ->objectManager ->create (UserModel::class);
44
57
}
45
58
46
59
/**
@@ -52,7 +65,7 @@ protected function setUp(): void
52
65
]
53
66
public function testLogDate ()
54
67
{
55
- $ user = DataFixtureStorageManager:: getStorage () ->get ('user ' );
68
+ $ user = $ this -> fixtures ->get ('user ' );
56
69
$ userName = $ user ->getDataByKey ('username ' );
57
70
$ this ->authModel ->login (
58
71
$ userName ,
0 commit comments