File tree Expand file tree Collapse file tree 5 files changed +75
-1
lines changed Expand file tree Collapse file tree 5 files changed +75
-1
lines changed Original file line number Diff line number Diff line change 1717 </testsuites >
1818 <filter >
1919 <whitelist processUncoveredFilesFromWhitelist =" true" >
20- <directory suffix = " Test.php " >tests </directory >
20+ <directory >src </directory >
2121 </whitelist >
2222 </filter >
2323</phpunit >
Original file line number Diff line number Diff line change 22
33namespace Byscripts \StaticEntity \Tests ;
44
5+ use Byscripts \StaticEntity \Tests \Fixtures \BadProperty ;
56use Byscripts \StaticEntity \Tests \Fixtures \Civility ;
67use Byscripts \StaticEntity \Tests \Fixtures \WebBrowser ;
78use PHPUnit \Framework \TestCase ;
@@ -131,4 +132,13 @@ public function testFindIds()
131132
132133 $ this ->assertEquals ([Civility::MR , Civility::MRS ], $ ids );
133134 }
135+
136+ /**
137+ * @expectedException \InvalidArgumentException
138+ * @expectedExceptionMessage has no property
139+ */
140+ public function testBadProperty ()
141+ {
142+ BadProperty::getAll ();
143+ }
134144}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Byscripts \StaticEntity \Tests \Fixtures ;
4+
5+ class BadClass
6+ {
7+ private $ foo ;
8+
9+ static function getDataSet (): array
10+ {
11+ return [
12+ 1 => [
13+ 'foo ' => 'bar ' ,
14+ ],
15+ 2 => [
16+ 'foo ' => 'bar ' ,
17+ 'bar ' => 'baz ' ,
18+ ],
19+ ];
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Byscripts \StaticEntity \Tests \Fixtures ;
4+
5+ use Byscripts \StaticEntity \AbstractStaticEntity ;
6+
7+ class BadProperty extends AbstractStaticEntity
8+ {
9+ private $ foo ;
10+
11+ static function getDataSet (): array
12+ {
13+ return [
14+ 1 => [
15+ 'foo ' => 'bar ' ,
16+ ],
17+ 2 => [
18+ 'foo ' => 'bar ' ,
19+ 'bar ' => 'baz ' ,
20+ ],
21+ ];
22+ }
23+ }
Original file line number Diff line number Diff line change 33namespace Byscripts \StaticEntity \Tests ;
44
55use Byscripts \StaticEntity \Provider ;
6+ use Byscripts \StaticEntity \Tests \Fixtures \BadClass ;
7+ use Byscripts \StaticEntity \Tests \Fixtures \BadProperty ;
68use Byscripts \StaticEntity \Tests \Fixtures \Civility ;
79use Byscripts \StaticEntity \Tests \Fixtures \WebBrowser ;
810use PHPUnit \Framework \TestCase ;
@@ -135,4 +137,22 @@ public function testFindIds()
135137
136138 $ this ->assertEquals ([Civility::MR , Civility::MRS ], $ ids );
137139 }
140+
141+ /**
142+ * @expectedException \InvalidArgumentException
143+ * @expectedExceptionMessage has no property
144+ */
145+ public function testBadProperty ()
146+ {
147+ Provider::getAll (BadProperty::class);
148+ }
149+
150+ /**
151+ * @expectedException \InvalidArgumentException
152+ * @expectedExceptionMessage must implements
153+ */
154+ public function testBadClass ()
155+ {
156+ Provider::getAll (BadClass::class);
157+ }
138158}
You can’t perform that action at this time.
0 commit comments