Skip to content

Commit d06fe67

Browse files
committed
Found the secret to nesting
1 parent 4392416 commit d06fe67

File tree

4 files changed

+594
-530
lines changed

4 files changed

+594
-530
lines changed

src/PHPDraft/Model/Elements/ObjectStructureElement.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function parse_value_structure($value, array &$dependencies)
9090
break;
9191
default:
9292
case 'object':
93-
$value = $value->content->value->content ?? null;
93+
$value = $value->content->value ?? null;
9494
$struct = $this->new_instance();
9595
break;
9696
}

src/PHPDraft/Parse/Tests/HtmlGeneratorTest.php

-24
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public function setUp(): void
4141
$data = json_decode(file_get_contents(TEST_STATICS . '/drafter/json/index.json'));
4242
$this->class = new HtmlGenerator();
4343
$this->reflection = new ReflectionClass('PHPDraft\Parse\HtmlGenerator');
44-
45-
$this->mock_function('microtime', function () { return 'sometime'; });
4644
$this->class->init($data);
4745

4846
$this->class->sorting = -1;
@@ -53,7 +51,6 @@ public function setUp(): void
5351
*/
5452
public function tearDown(): void
5553
{
56-
$this->unmock_function('microtime');
5754
uopz_undefine('ID_STATIC');
5855
unset($this->class);
5956
unset($this->reflection);
@@ -74,38 +71,17 @@ public function testSetupCorrectly(): void
7471
*/
7572
public function testGetHTML(): void
7673
{
77-
$old = THIRD_PARTY_ALLOWED;
78-
$this->constant_redefine('THIRD_PARTY_ALLOWED', true);
7974
$this->expectOutputString(file_get_contents(TEST_STATICS . '/drafter/html/basic.html'));
8075
$this->class->get_html();
81-
$this->constant_redefine('THIRD_PARTY_ALLOWED', $old);
82-
}
83-
84-
/**
85-
* Tests if the constructor sets the property correctly
86-
*/
87-
public function testGetHTMLInheritance(): void
88-
{
89-
$this->markTestSkipped('Not testing.');
90-
$old = THIRD_PARTY_ALLOWED;
91-
$this->constant_redefine('THIRD_PARTY_ALLOWED', true);
92-
$class = new HtmlGenerator();
93-
$class->init(json_decode(file_get_contents(TEST_STATICS . '/drafter/json/inheritance.json')));
94-
$this->expectOutputString(file_get_contents(TEST_STATICS . '/drafter/html/inheritance.html'));
95-
$class->get_html();
96-
$this->constant_redefine('THIRD_PARTY_ALLOWED', $old);
9776
}
9877

9978
/**
10079
* Tests if the constructor sets the property correctly
10180
*/
10281
public function testGetHTMLMaterial(): void
10382
{
104-
$old = THIRD_PARTY_ALLOWED;
105-
$this->constant_redefine('THIRD_PARTY_ALLOWED', true);
10683
$this->expectOutputString(file_get_contents(TEST_STATICS . '/drafter/html/material.html'));
10784
$this->class->get_html('material');
108-
$this->constant_redefine('THIRD_PARTY_ALLOWED', $old);
10985
}
11086

11187
/**

0 commit comments

Comments
 (0)