/** * @covers Marando\AstroDate\AstroDate::__toString */ public function test__toString() { $dt = new AstroDate(1960, 2, 23, 19, 20, 12); AstroDate::FORMAT_DEFAULT; $tests = ['Y M. c T' => '1960 Feb. 23.8056944 UTC', 'r Y-M-c T' => 'A.D. 1960-Feb-23.8056944 UTC', 'Y-M-d H:i:s.u T' => '1960-Feb-23 19:20:12.000 UTC']; foreach ($tests as $format => $str) { $dt->format($format); // Check that format persists with to string $this->assertEquals($str, (string) $dt, $format); } }