You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Query/Mysql/TrigTest.php
+8-29Lines changed: 8 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,6 @@
3
3
namespaceDoctrineExtensions\Tests\Query\Mysql;
4
4
5
5
useDoctrine\ORM\Query;
6
-
useDoctrine\ORM\Version;
7
6
useDoctrineExtensions\Tests\Query\MysqlTestCase;
8
7
9
8
usefunctiondeg2rad;
@@ -42,13 +41,8 @@ public function testSin(): void
42
41
$sql = 'SELECT SIN(RADIANS(b0_.latitude) * RADIANS(b0_.longitude)) AS sclr_0 FROM BlogPost b0_';
43
42
$this->assertEquals($sql, $q->getSql());
44
43
45
-
if (Version::compare('2.4.0') <= 0) {
46
-
$dql = 'SELECT p FROM ' . $this->entity . ' p WHERE p.longitude = SIN(RADIANS(p.latitude)) * RADIANS(p.longitude)';
47
-
} else {
48
-
$dql = 'SELECT p FROM ' . $this->entity . ' p WHERE p.longitude = (SIN(RADIANS(p.latitude)) * RADIANS(p.longitude))';
49
-
}
50
-
51
-
$q = $this->entityManager->createQuery($dql);
44
+
$dql = 'SELECT p FROM ' . $this->entity . ' p WHERE p.longitude = SIN(RADIANS(p.latitude)) * RADIANS(p.longitude)';
45
+
$q = $this->entityManager->createQuery($dql);
52
46
53
47
$sql = 'SELECT b0_.id AS id_0, b0_.created AS created_1, b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 FROM BlogPost b0_ WHERE b0_.longitude = SIN(RADIANS(b0_.latitude)) * RADIANS(b0_.longitude)';
54
48
$this->assertEquals($sql, $q->getSql());
@@ -59,13 +53,8 @@ public function testSin(): void
59
53
$sql = 'SELECT b0_.id AS id_0, b0_.created AS created_1, b0_.longitude AS longitude_2, b0_.latitude AS latitude_3 FROM BlogPost b0_ WHERE SIN(RADIANS(b0_.latitude)) * SIN(RADIANS(b0_.longitude)) = 1';
60
54
$this->assertEquals($sql, $q->getSql());
61
55
62
-
if (Version::compare('2.4.0') <= 0) {
63
-
$dql = 'SELECT SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) FROM ' . $this->entity . ' p ';
64
-
} else {
65
-
$dql = 'SELECT (SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude))) FROM ' . $this->entity . ' p ';
66
-
}
67
-
68
-
$q = $this->entityManager->createQuery($dql);
56
+
$dql = 'SELECT SIN(RADIANS(p.latitude)) * SIN(RADIANS(p.longitude)) FROM ' . $this->entity . ' p ';
57
+
$q = $this->entityManager->createQuery($dql);
69
58
70
59
$sql = 'SELECT SIN(RADIANS(b0_.latitude)) * SIN(RADIANS(b0_.longitude)) AS sclr_0 FROM BlogPost b0_';
71
60
$this->assertEquals($sql, $q->getSql());
@@ -82,13 +71,8 @@ public function testAcos(): void
0 commit comments