@@ -42,6 +42,52 @@ public function errors_are_converted_to_exceptions()
4242 $ bootstrapper ->handleError (E_USER_ERROR , 'Test Error ' );
4343 }
4444
45+ /**
46+ * @test
47+ */
48+ public function E_NOTICE_errors_are_not_converted_to_exceptions ()
49+ {
50+ Functions \expect ('is_admin ' )->once ()->andReturn (false );
51+
52+ $ app = new Application ;
53+ $ handler = Mockery::mock (HandlerInterface::class);
54+ $ app ->bind (HandlerInterface::class, $ handler );
55+ $ config = new Config ();
56+ $ app ->bind ('config ' , $ config );
57+ $ app ->bind (Config::class, $ config );
58+
59+ $ handler ->shouldReceive ('report ' )->once ()->with (Mockery::on (function ($ e ) {
60+ return $ e ->getSeverity () === E_NOTICE && $ e ->getMessage () === 'Test Error ' ;
61+ }));
62+
63+ $ bootstrapper = new RegisterExceptionHandler ();
64+ $ bootstrapper ->bootstrap ($ app );
65+ $ bootstrapper ->handleError (E_NOTICE , 'Test Error ' );
66+ }
67+
68+ /**
69+ * @test
70+ */
71+ public function E_WARNING_errors_are_not_converted_to_exceptions ()
72+ {
73+ Functions \expect ('is_admin ' )->once ()->andReturn (false );
74+
75+ $ app = new Application ;
76+ $ handler = Mockery::mock (HandlerInterface::class);
77+ $ app ->bind (HandlerInterface::class, $ handler );
78+ $ config = new Config ();
79+ $ app ->bind ('config ' , $ config );
80+ $ app ->bind (Config::class, $ config );
81+
82+ $ handler ->shouldReceive ('report ' )->once ()->with (Mockery::on (function ($ e ) {
83+ return $ e ->getSeverity () === E_WARNING && $ e ->getMessage () === 'Test Error ' ;
84+ }));
85+
86+ $ bootstrapper = new RegisterExceptionHandler ();
87+ $ bootstrapper ->bootstrap ($ app );
88+ $ bootstrapper ->handleError (E_WARNING , 'Test Error ' );
89+ }
90+
4591 /**
4692 * @test
4793 */
0 commit comments