@@ -116,41 +116,30 @@ public function testSaveWithSubject()
116
116
}
117
117
118
118
/**
119
- * Test save with no subject ID provided
120
- *
121
- * @param bool $isLoggedIn
122
- * @dataProvider dataProviderTestSaveWithoutSubject
119
+ * Test save with no subject ID provided and customer is logged in
123
120
*/
124
- public function testSaveWithoutSubject ( bool $ isLoggedIn )
121
+ public function testSaveWithoutSubjectWhenLoggedIn ( )
125
122
{
126
- if ($ isLoggedIn ) {
127
- $ this ->customerSessionMock ->expects ($ this ->once ())
128
- ->method ('isLoggedIn ' )
129
- ->willReturn (true );
130
- $ this ->customerSessionMock ->expects ($ this ->once ())
131
- ->method ('getCustomerId ' )
132
- ->willReturn (1 );
133
- } else {
134
- $ this ->customerSessionMock ->expects ($ this ->once ())
135
- ->method ('isLoggedIn ' )
136
- ->willReturn (false );
137
- $ this ->customerVisitorMock ->expects ($ this ->once ())
138
- ->method ('getId ' )
139
- ->willReturn (2 );
140
- }
123
+ $ this ->customerSessionMock ->expects ($ this ->once ())
124
+ ->method ('isLoggedIn ' )
125
+ ->willReturn (true );
126
+ $ this ->customerSessionMock ->expects ($ this ->once ())
127
+ ->method ('getCustomerId ' )
128
+ ->willReturn (1 );
141
129
$ this ->eventSaver ->save (1 , 1 , null );
142
130
}
143
131
144
132
/**
145
- * Data provider for a case without subjectId provided
146
- *
147
- * @return array
133
+ * Test save with no subject ID provided and customer is not logged in
148
134
*/
149
- public function dataProviderTestSaveWithoutSubject ()
135
+ public function testSaveWithoutSubjectForGuest ()
150
136
{
151
- return [
152
- [true ],
153
- [false ]
154
- ];
137
+ $ this ->customerSessionMock ->expects ($ this ->once ())
138
+ ->method ('isLoggedIn ' )
139
+ ->willReturn (false );
140
+ $ this ->customerVisitorMock ->expects ($ this ->once ())
141
+ ->method ('getId ' )
142
+ ->willReturn (2 );
143
+ $ this ->eventSaver ->save (1 , 1 , null );
155
144
}
156
145
}
0 commit comments