@@ -48,20 +48,38 @@ public function testStatus()
4848
4949 public function testStart ()
5050 {
51- $ date = new \DateTime ();
51+ $ date = new \DateTime (' 2018-03-31 11:33:42 ' );
5252 $ this ->filter ->setStart ($ date );
5353 $ query = $ this ->filter ->getQuery ();
5454 $ this ->assertArrayHasKey ('date_start ' , $ query );
55- $ this ->assertEquals ($ date ->format ('c ' ), $ query ['date_start ' ]);
55+ $ this ->assertEquals ('2018-03-31T11:33:42Z ' , $ query ['date_start ' ]);
56+ }
57+
58+ public function testStartOtherTimezone ()
59+ {
60+ $ date = new \DateTime ('2018-03-31 11:33:42-03:00 ' );
61+ $ this ->filter ->setStart ($ date );
62+ $ query = $ this ->filter ->getQuery ();
63+ $ this ->assertArrayHasKey ('date_start ' , $ query );
64+ $ this ->assertEquals ('2018-03-31T14:33:42Z ' , $ query ['date_start ' ]);
5665 }
5766
5867 public function testEnd ()
5968 {
60- $ date = new \DateTime ();
69+ $ date = new \DateTime ('2018-03-31 11:33:42 ' );
70+ $ this ->filter ->setEnd ($ date );
71+ $ query = $ this ->filter ->getQuery ();
72+ $ this ->assertArrayHasKey ('date_end ' , $ query );
73+ $ this ->assertEquals ('2018-03-31T11:33:42Z ' , $ query ['date_end ' ]);
74+ }
75+
76+ public function testEndOtherTimezone ()
77+ {
78+ $ date = new \DateTime ('2018-03-31 11:33:42+03:00 ' );
6179 $ this ->filter ->setEnd ($ date );
6280 $ query = $ this ->filter ->getQuery ();
6381 $ this ->assertArrayHasKey ('date_end ' , $ query );
64- $ this ->assertEquals ($ date -> format ( ' c ' ) , $ query ['date_end ' ]);
82+ $ this ->assertEquals (' 2018-03-31T08:33:42Z ' , $ query ['date_end ' ]);
6583 }
6684
6785 public function testSize ()
0 commit comments