File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1414 */
1515class AbstractApiTest extends TestCase
1616{
17+ /**
18+ * @test
19+ * @dataProvider getIsNotNullReturnsCorrectBooleanData
20+ */
21+ public function testIsNotNullReturnsCorrectBoolean (bool $ expected , $ value )
22+ {
23+ $ client = $ this ->createMock (Client::class);
24+
25+ $ api = $ this ->getMockForAbstractClass (AbstractApi::class, [$ client ]);
26+
27+ $ method = new ReflectionMethod ($ api , 'isNotNull ' );
28+ $ method ->setAccessible (true );
29+
30+ $ this ->assertSame ($ expected , $ method ->invoke ($ api , $ value ));
31+ }
32+
33+ public function getIsNotNullReturnsCorrectBooleanData ()
34+ {
35+ return [
36+ [false , null ],
37+ [false , false ],
38+ [false , '' ],
39+ [false , []],
40+ [true , true ],
41+ [true , 0 ],
42+ [true , 1 ],
43+ [true , 0.0 ],
44+ [true , -0.0 ],
45+ [true , 0.5 ],
46+ [true , '0 ' ],
47+ [true , 'string ' ],
48+ [true , [0 ]],
49+ [true , ['0 ' ]],
50+ [true , ['' ]],
51+ [true , new \stdClass ],
52+ ];
53+ }
54+
1755 /**
1856 * @covers \Redmine\Api\AbstractApi
1957 * @test
You can’t perform that action at this time.
0 commit comments