Skip to content

Commit 716d041

Browse files
committed
fixed definition, refactoring parent test
1 parent 0373429 commit 716d041

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

tests/src/Helper/LevelOneClass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use Yaoi\Schema\Schema;
88
use Yaoi\Schema\Structure\ClassStructure;
99

10+
/**
11+
* @method import
12+
*/
1013
class LevelOneClass extends ClassStructure
1114
{
1215
/**

tests/src/Schema/ParentFixedTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,26 @@
77

88
class ParentFixedTest extends ParentTest
99
{
10+
/**
11+
* @return \Yaoi\Schema\Schema|LevelOneClass
12+
*/
1013
protected function deepSchema()
1114
{
1215
$schema = LevelOneClass::makeSchema();
1316
return $schema;
1417
}
1518

19+
public function testImport()
20+
{
21+
$object = $this->deepSchema()->import(array(
22+
'level1' => array(
23+
'level2' => array(
24+
'level3' => 123 // integer required
25+
),
26+
),
27+
));
28+
$this->assertSame(123, $object->level1->level2->level3);
29+
}
30+
31+
1632
}

tests/src/Schema/ParentTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ protected function deepSchema()
3333
return $schema;
3434
}
3535

36-
37-
38-
3936
private function assertSchema(Schema $schema)
4037
{
4138
$level1Schema = Properties::getFromSchema($schema)->getProperty('level1');

0 commit comments

Comments
 (0)