@@ -56,8 +56,8 @@ public function tearDown()
5656 public function testCount ()
5757 {
5858 $ this ->assertEquals (3 , $ this ->pool ->find (Writer::class)->count ());
59- $ this ->assertEquals (2 , $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 1 )->count ());
60- $ this ->assertEquals (1 , $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 2 )->count ());
59+ $ this ->assertEquals (2 , $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 1 )->count ());
60+ $ this ->assertEquals (1 , $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 2 )->count ());
6161 }
6262
6363 /**
@@ -72,13 +72,13 @@ public function testFindAll()
7272 $ this ->assertCount (3 , $ result );
7373
7474 /** @var Result $result */
75- $ result = $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 1 )->all ();
75+ $ result = $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 1 )->all ();
7676
7777 $ this ->assertInstanceOf (Result::class, $ result );
7878 $ this ->assertCount (2 , $ result );
7979
8080 /** @var Result $result */
81- $ result = $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 2 )->all ();
81+ $ result = $ this ->pool ->find (Writer::class)->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 2 )->all ();
8282
8383 $ this ->assertInstanceOf (Result::class, $ result );
8484 $ this ->assertCount (1 , $ result );
@@ -97,14 +97,14 @@ public function testFindFirst()
9797 $ this ->assertEquals ('Leo Tolstoy ' , $ should_be_tolstoy ->getName ());
9898
9999 /** @var Writer $should_be_tolstoy */
100- $ should_be_tolstoy = $ this ->pool ->find (Writer::class)->orderBy ('`id` ' )->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 1 )->first ();
100+ $ should_be_tolstoy = $ this ->pool ->find (Writer::class)->orderBy ('`id` ' )->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 1 )->first ();
101101
102102 $ this ->assertInstanceOf (Writer::class, $ should_be_tolstoy );
103103 $ this ->assertTrue ($ should_be_tolstoy ->isLoaded ());
104104 $ this ->assertEquals ('Leo Tolstoy ' , $ should_be_tolstoy ->getName ());
105105
106106 /** @var Writer $should_be_dostoyevsky */
107- $ should_be_dostoyevsky = $ this ->pool ->find (Writer::class)->orderBy ('`id` ' )->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 2 )->first ();
107+ $ should_be_dostoyevsky = $ this ->pool ->find (Writer::class)->orderBy ('`id` ' )->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 2 )->first ();
108108
109109 $ this ->assertInstanceOf (Writer::class, $ should_be_dostoyevsky );
110110 $ this ->assertTrue ($ should_be_dostoyevsky ->isLoaded ());
@@ -116,19 +116,19 @@ public function testFindFirst()
116116 */
117117 public function testFindAllIds ()
118118 {
119- $ ids = $ this ->pool ->find (Writer::class)->orderBy ('id ' )->ids ();
119+ $ ids = $ this ->pool ->find (Writer::class)->orderBy ('`id` ' )->ids ();
120120
121121 $ this ->assertInternalType ('array ' , $ ids );
122122 $ this ->assertCount (3 , $ ids );
123123 $ this ->assertEquals ([1 , 2 , 3 ], $ ids );
124124
125- $ ids = $ this ->pool ->find (Writer::class)->orderBy ('id ' )->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 1 )->ids ();
125+ $ ids = $ this ->pool ->find (Writer::class)->orderBy ('`id` ' )->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 1 )->ids ();
126126
127127 $ this ->assertInternalType ('array ' , $ ids );
128128 $ this ->assertCount (2 , $ ids );
129129 $ this ->assertEquals ([1 , 2 ], $ ids );
130130
131- $ ids = $ this ->pool ->find (Writer::class)->orderBy ('id ' )->joinTable ('writer_groups ' )->where ('writer_groups. group_id = ? ' , 2 )->ids ();
131+ $ ids = $ this ->pool ->find (Writer::class)->orderBy ('`id` ' )->joinTable ('writer_groups ' )->where ('` writer_groups`.` group_id` = ? ' , 2 )->ids ();
132132
133133 $ this ->assertInternalType ('array ' , $ ids );
134134 $ this ->assertCount (1 , $ ids );
0 commit comments