@@ -31,39 +31,24 @@ class BookmarkRepositoryTest extends \PHPUnit_Framework_TestCase
31
31
*/
32
32
protected $ bookmark ;
33
33
34
- /**
35
- * @var \Magento\Customer\Api\CustomerRepositoryInterface
36
- */
37
- protected $ customerRepository ;
38
-
39
34
protected function setUp ()
40
35
{
41
36
$ this ->bookmarkRepository = Bootstrap::getObjectManager ()
42
37
->create ('Magento\Ui\Model\Resource\BookmarkRepository ' );
43
38
$ this ->bookmarkFactory = Bootstrap::getObjectManager ()->create ('Magento\Ui\Model\BookmarkFactory ' );
44
39
45
- /** @var $customerRepository \Magento\Customer\Api\CustomerRepositoryInterface */
46
- $ this ->customerRepository = Bootstrap::getObjectManager ()
47
- ->create ('Magento\Customer\Api\CustomerRepositoryInterface ' );
48
- $ newCustomerEntity = Bootstrap::getObjectManager ()
49
- ->create ('Magento\Customer\Api\Data\CustomerInterfaceFactory ' )
50
- ->create ()
51
- ->setStoreId (1 )
52
- ->setWebsiteId (1 )
53
- ->setEmail ('bookmark_user@example.com ' )
54
- ->setFirstname ('TestFn ' )
55
- ->setLastname ('TestLn ' )
56
- ->setGroupId (1 );
57
- $ newCustomerEntity = $ this ->customerRepository ->save ($ newCustomerEntity );
40
+ /** @var $adminUser \Magento\User\Model\User */
41
+ $ adminUser = Bootstrap::getObjectManager ()->create ('Magento\User\Model\User ' );
42
+ $ defaultAdminUserName = 'user ' ;
43
+ $ adminUser ->load ($ defaultAdminUserName , 'username ' );
58
44
59
- $ this ->bookmark = $ this ->bookmarkFactory ->create ()->setUserId ($ newCustomerEntity ->getId ())->setTitle ('test ' );
45
+ $ this ->bookmark = $ this ->bookmarkFactory ->create ()->setUserId ($ adminUser ->getId ())->setTitle ('test ' );
60
46
$ this ->bookmark = $ this ->bookmarkRepository ->save ($ this ->bookmark );
61
47
}
62
48
63
49
protected function tearDown ()
64
50
{
65
51
$ this ->bookmarkRepository ->delete ($ this ->bookmark );
66
- $ this ->customerRepository ->delete ($ this ->customerRepository ->get ('bookmark_user@example.com ' ));
67
52
}
68
53
69
54
public function testGetList ()
0 commit comments