@@ 38-44 (lines=7) @@ | ||
35 | } |
|
36 | ||
37 | /** @test */ |
|
38 | public function addingOrderBy() |
|
39 | { |
|
40 | $this->resultSet->orderBy('id'); |
|
41 | $sql = 'SELECT * FROM ' . static::TABLE_NAME . ' ORDER BY id ASC'; |
|
42 | ||
43 | $this->assertEquals((string) $this->resultSet, $sql); |
|
44 | } |
|
45 | ||
46 | /** @test */ |
|
47 | public function addingWhere() |
|
@@ 47-54 (lines=8) @@ | ||
44 | } |
|
45 | ||
46 | /** @test */ |
|
47 | public function addingWhere() |
|
48 | { |
|
49 | $this->resultSet->where('id', 1); |
|
50 | ||
51 | $sql = 'SELECT * FROM ' . static::TABLE_NAME . ' WHERE id = ?'; |
|
52 | ||
53 | $this->assertEquals((string) $this->resultSet, $sql); |
|
54 | } |
|
55 | ||
56 | /** @test */ |
|
57 | public function addingWhereInArray() |
|
@@ 57-64 (lines=8) @@ | ||
54 | } |
|
55 | ||
56 | /** @test */ |
|
57 | public function addingWhereInArray() |
|
58 | { |
|
59 | $this->resultSet->where(['id' => 1]); |
|
60 | ||
61 | $sql = 'SELECT * FROM ' . static::TABLE_NAME . ' WHERE id = ?'; |
|
62 | ||
63 | $this->assertEquals((string) $this->resultSet, $sql); |
|
64 | } |
|
65 | ||
66 | /** @test */ |
|
67 | public function addingFullSyntax() |
|
@@ 67-74 (lines=8) @@ | ||
64 | } |
|
65 | ||
66 | /** @test */ |
|
67 | public function addingFullSyntax() |
|
68 | { |
|
69 | $this->resultSet->where('id = ?', 1); |
|
70 | ||
71 | $sql = 'SELECT * FROM ' . static::TABLE_NAME . ' WHERE id = ?'; |
|
72 | ||
73 | $this->assertEquals((string) $this->resultSet, $sql); |
|
74 | } |
|
75 | ||
76 | /** @test */ |
|
77 | public function addingWhereWithoutValue() |
|
@@ 77-84 (lines=8) @@ | ||
74 | } |
|
75 | ||
76 | /** @test */ |
|
77 | public function addingWhereWithoutValue() |
|
78 | { |
|
79 | $this->resultSet->where('id IS NULL'); |
|
80 | ||
81 | $sql = 'SELECT * FROM ' . static::TABLE_NAME . ' WHERE id IS NULL'; |
|
82 | ||
83 | $this->assertEquals((string) $this->resultSet, $sql); |
|
84 | } |
|
85 | } |