|
public function testShouldLayoutAbsoluteByRelative(): void |
|
{ |
|
$result = Vbml::parse([ |
|
'style' => ['height' => 22, 'width' => 6], |
|
'components' => [ |
|
['template' => 'abc', 'style' => ['height' => 6, 'width' => 22, 'align' => 'top', 'justify' => 'left']], |
|
['template' => 'def', 'style' => ['height' => 1, 'width' => 3, 'align' => 'top', 'justify' => 'left', 'absolutePosition' => ['x' => 3, 'y' => 0]]], |
|
], |
|
]); |
|
$expected = [1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; |
|
$this->assertEquals($expected, $result[0]); |
|
} |
|
|
|
public function testShouldLayoutAbsoluteOverRelative(): void |
|
{ |
|
$result = Vbml::parse([ |
|
'style' => ['height' => 22, 'width' => 6], |
|
'components' => [ |
|
['template' => 'abc', 'style' => ['height' => 6, 'width' => 22, 'align' => 'top', 'justify' => 'left']], |
|
['template' => 'def', 'style' => ['height' => 1, 'width' => 3, 'align' => 'top', 'justify' => 'left', 'absolutePosition' => ['x' => 0, 'y' => 0]]], |
|
], |
|
]); |
|
$expected = [4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; |
|
$this->assertEquals($expected, $result[0]); |
|
} |
The following tests request a board that should be created with a height of 22 and a width of 6 (inverted flagship height/width), but the expected result passes with a width of 22, meaning the board style isn't actually enforced in underlying code.
vbml/src/__tests__/vbml.spec.ts
Lines 175 to 245 in 1281038
The python and php code have similar tests, but the board dimensions are respected. However, the php test fails as it is using the same expected result the TS/JS test used.
vbml/php/tests/VbmlTest.php
Lines 89 to 113 in 1281038