summaryrefslogtreecommitdiff
path: root/tests/UnitTests/TemplateSource/ValueTests/Operators/OperatorsTest.php
blob: ea66108b115eb124f6b4f3b282d1d28cf34f3e1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

class OperatorsTest extends PHPUnit_Smarty {
	public function setUp(): void
	{
		$this->setUpSmarty(__DIR__);
	}


	/**
	 * @group issue861
	 */
	public function testTernaries() {
		$this->assertEquals('2 equals 2', $this->smarty->fetch("string:{(2 === 2) ? '2 equals 2' : '2 ain\'t 2'}"));
		$this->assertEquals('3 equals 3', $this->smarty->fetch("string:{(3 == 3) ? '3 equals 3' : '3 ain\'t 3'}"));
		$this->assertEquals('4 equals 4', $this->smarty->fetch("string:{(4 !== 4) ? '4 ain\'t 4' : '4 equals 4'}"));
	}

}