|
22 | 22 |
|
23 | 23 | /** |
24 | 24 | * LogOut test. |
| 25 | + * Test for Logout |
25 | 26 | */ |
26 | 27 | class LogOutTest extends TestCase |
27 | 28 | { |
@@ -76,11 +77,12 @@ class LogOutTest extends TestCase |
76 | 77 | protected function setUp(): void |
77 | 78 | { |
78 | 79 | $this->curlFactoryMock = $this->createMock(CurlFactory::class); |
79 | | - $this->userProfileInterfaceMock = $this->createMock(UserProfileInterface::class); |
80 | | - $this->userProfileRepositoryInterfaceMock = $this->createMock(UserProfileRepositoryInterface::class); |
81 | | - $this->userContextInterfaceMock = $this->createMock(UserContextInterface::class); |
82 | | - $this->configInterfaceMock = $this->createMock(ConfigInterface::class); |
83 | | - $this->loggerInterfaceMock = $this->createMock(LoggerInterface::class); |
| 80 | + $this->userProfileInterfaceMock = $this->getMockForAbstractClass(UserProfileInterface::class); |
| 81 | + $this->userProfileRepositoryInterfaceMock = $this |
| 82 | + ->getMockForAbstractClass(UserProfileRepositoryInterface::class); |
| 83 | + $this->userContextInterfaceMock = $this->getMockForAbstractClass(UserContextInterface::class); |
| 84 | + $this->configInterfaceMock = $this->getMockForAbstractClass(ConfigInterface::class); |
| 85 | + $this->loggerInterfaceMock = $this->getMockForAbstractClass(LoggerInterface::class); |
84 | 86 | $this->model = new LogOut( |
85 | 87 | $this->userContextInterfaceMock, |
86 | 88 | $this->userProfileRepositoryInterfaceMock, |
@@ -123,7 +125,7 @@ public function testExecute(): void |
123 | 125 | $this->userProfileRepositoryInterfaceMock->expects($this->once()) |
124 | 126 | ->method('save') |
125 | 127 | ->willReturn(null); |
126 | | - $this->assertEquals(true, $this->model->execute()); |
| 128 | + $this->assertTrue($this->model->execute()); |
127 | 129 | } |
128 | 130 |
|
129 | 131 | /** |
@@ -154,7 +156,7 @@ public function testExecuteWithError(): void |
154 | 156 | ->willReturn(self::HTTP_ERROR); |
155 | 157 | $this->loggerInterfaceMock->expects($this->once()) |
156 | 158 | ->method('critical'); |
157 | | - $this->assertEquals(false, $this->model->execute()); |
| 159 | + $this->assertFalse($this->model->execute()); |
158 | 160 | } |
159 | 161 |
|
160 | 162 | /** |
|
0 commit comments