1: <?php
2:
3: namespace Alchemy\tests;
4: use Alchemy\core\query\Scalar;
5:
6:
7:
8: class ScalarTest extends BaseTest {
9:
10: public function testScalar() {
11: $v = new Scalar(false);
12: $this->assertEquals('boolean', $v->getTag('expr.value'));
13: $this->assertEquals(false, $v->getValue());
14:
15: $v = new Scalar(true);
16: $this->assertEquals('boolean', $v->getTag('expr.value'));
17: $this->assertEquals(true, $v->getValue());
18:
19: $v = new Scalar(null);
20: $this->assertEquals('null', $v->getTag('expr.value'));
21: $this->assertEquals(null, $v->getValue());
22:
23: $v = new Scalar(42);
24: $this->assertEquals('integer', $v->getTag('expr.value'));
25: $this->assertEquals(42, $v->getValue());
26:
27: $v = new Scalar('dolphins');
28: $this->assertEquals('string', $v->getTag('expr.value'));
29: $this->assertEquals('dolphins', $v->getValue());
30: }
31: }
32: