We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a0cefa commit ed1c375Copy full SHA for ed1c375
tests/render.php
@@ -127,6 +127,21 @@ public function __get($name)
127
$this->assertTrue($result->__toBoolean());
128
}
129
130
+ public function testTernary()
131
+ {
132
+ $jsPhpize = new JsPhpize();
133
+
134
+ $result = $jsPhpize->renderCode('return val === 42 ? {"answer": "42"} : {"ko": "failed"}', [
135
+ 'val' => 42,
136
+ ]);
137
+ $this->assertSame(['answer' => '42'], $result);
138
139
140
+ 'val' => 1,
141
142
+ $this->assertSame(['ko' => 'failed'], $result);
143
+ }
144
145
public function testDollarVariablePrefix()
146
{
147
$jsPhpize = new JsPhpize([
0 commit comments