Skip to content

Commit 3fe2369

Browse files
committed
Update unit tests
1 parent 4e36a7f commit 3fe2369

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

Tests/DefinitionTest.php

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,64 @@ public function testConstructFromArray() : void
197197
'integer' => 10,
198198
'string' => 'stringLn10',
199199
'enum' => 'primary_email',
200-
'array' => ['one' => false, 'two' => 2, 'three' => '3', 'four' => 1.23],
200+
'array' => ['one' => 1, 'two' => 2, 'three' => 3],
201201
'float' => 3.1415926,
202202
'ucEnum' => 'SCHEDULED',
203203
'intEnum' => 5,
204204
];
205+
205206
$fixture = new \Tests\Fixtures\TypeTest($original);
206207
$this->assertEquals($original, $fixture->getData());
207208
}
209+
210+
public function testConstructFromObject() : void
211+
{
212+
$testClass = new \Tests\Fixtures\ClassTest();
213+
$original = [
214+
'class' => $testClass,
215+
];
216+
$fixture = new \Tests\Fixtures\TypeTest($original);
217+
218+
$this->assertEquals($testClass, $fixture->class);
219+
}
220+
221+
public function testClassArray() : void
222+
{
223+
$testClass = new \Tests\Fixtures\ClassTest();
224+
$original = [
225+
'classArray' => [$testClass, new \Tests\Fixtures\ClassTest(), ],
226+
];
227+
228+
$fixture = new \Tests\Fixtures\TypeTest($original);
229+
230+
$this->assertIsArray($fixture->classArray);
231+
$this->assertCount(2, $fixture->classArray);
232+
}
233+
234+
public function testClassArraySize() : void
235+
{
236+
$testClass = new \Tests\Fixtures\ClassTest();
237+
$original = [
238+
'classArraySize' => [$testClass, new \Tests\Fixtures\ClassTest(), ],
239+
];
240+
241+
$fixture = new \Tests\Fixtures\TypeTest($original);
242+
243+
$this->assertIsArray($fixture->classArraySize);
244+
$this->assertCount(2, $fixture->classArraySize);
245+
}
246+
247+
public function testClassArraySizeMin() : void
248+
{
249+
$testClass = new \Tests\Fixtures\ClassTest();
250+
$original = [
251+
'classArraySizeMin' => [$testClass, new \Tests\Fixtures\ClassTest(), ],
252+
];
253+
254+
$fixture = new \Tests\Fixtures\TypeTest($original);
255+
256+
$this->assertIsArray($fixture->classArraySizeMin);
257+
$this->assertCount(2, $fixture->classArraySizeMin);
258+
}
259+
208260
}

Tests/SyntaxTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ public function testDirectory() : void
1515
{
1616
$this->skipNamespaceTesting();
1717
$this->assertValidPHPDirectory(PROJECT_ROOT . '/src', 'src directory has an error');
18-
$this->assertValidPHPDirectory(PROJECT_ROOT . '/Tools', 'Tools directory has an error');
18+
$this->assertValidPHPDirectory(PROJECT_ROOT . '/Tool', 'Tool directory has an error');
1919
}
2020
}

0 commit comments

Comments
 (0)