@@ -16,38 +16,34 @@ public function test_value_object_is_returned()
1616 new NoticeContent ('This is a notice. ' , 'success ' )
1717 );
1818
19- $ this ->assertInstanceOf (' \Noticeable\ NoticeContent' , Notice::get ());
19+ $ this ->assertInstanceOf (NoticeContent::class , Notice::get ());
2020 }
2121
2222 /**
2323 * @test
2424 */
25- public function test_message_cannot_be_empty_on_set ()
25+ public function test_no_errors_when_notice_isnt_set ()
2626 {
27- $ this ->expectException (\InvalidArgumentException::class);
28-
29- Notice::set (
30- new NoticeContent ('' , 'success ' )
31- );
27+ $ this ->assertInstanceOf (NoticeContent::class, Notice::get ());
3228 }
3329
3430 /**
3531 * @test
3632 */
37- public function test_type_cannot_be_empty_on_set ()
33+ public function test_notice_is_cleared_after_initial_get ()
3834 {
39- $ this ->expectException (\InvalidArgumentException::class);
40-
4135 Notice::set (
42- new NoticeContent ('This is a notice. ' , '' )
36+ new NoticeContent ('This is a notice. ' , 'success ' )
4337 );
44- }
4538
46- /**
47- * @test
48- */
49- public function test_no_errors_when_notice_doesnt_exist ()
50- {
51- $ this ->assertInstanceOf ('\Noticeable\NoticeContent ' , Notice::get ());
39+ $ notice_1 = Notice::get ();
40+
41+ // Content was successfully retrieved on first get
42+ $ this ->assertFalse ($ notice_1 ->isEmpty ());
43+
44+ $ notice_2 = Notice::get ();
45+
46+ // Content was successfully removed on first get
47+ $ this ->assertTrue ($ notice_2 ->isEmpty ());
5248 }
5349}
0 commit comments