Display the drop-down list

Test of date_sun_info()

Example #1 : test not validated (platform dependant or random result etc.)
Example #2 : test success
Example #3 : test success
Example #1
$input = [
  
'timezone' => 'Europe/Paris',
  
'time' => 'now',
  
'city' => 'Paris',
  
=> '$timestamp',
  
=> '$latitude',
  
=> '$longitude',
]
test not validated (platform dependant or random result etc.)
$test_output = [
  
'result' => [
    
'timestamp' => 1652812343,
    
'latitude' => 48.85,
    
'longitude' => 2.35,
    
'array' => [
      
'sunrise' => 1652760330,
      
'sunset' => 1652815712,
      
'transit' => 1652788021,
      
'civil_twilight_begin' => 1652758026,
      
'civil_twilight_end' => 1652818015,
      
'nautical_twilight_begin' => 1652754967,
      
'nautical_twilight_end' => 1652821074,
      
'astronomical_twilight_begin' => 1652750931,
      
'astronomical_twilight_end' => 1652825110,
    ],
    
'date_sun_info' => [
      
'sunrise' => '06:05:30',
      
'sunset' => '21:28:32',
      
'transit' => '13:47:01',
      
'civil_twilight_begin' => '05:27:06',
      
'civil_twilight_end' => '22:06:55',
      
'nautical_twilight_begin' => '04:36:07',
      
'nautical_twilight_end' => '22:57:54',
      
'astronomical_twilight_begin' => '03:28:51',
      
'astronomical_twilight_end' => '00:05:10',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
'timezone' => 'UTC',
  
'time' => '2006-12-12',
  
=> '$timestamp',
  
=> 31.7667,
  
=> 35.2333,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'timestamp' => 1165881600,
    
'array' => [
      
'sunrise' => 1165897782,
      
'sunset' => 1165934168,
      
'transit' => 1165915975,
      
'civil_twilight_begin' => 1165896176,
      
'civil_twilight_end' => 1165935773,
      
'nautical_twilight_begin' => 1165894353,
      
'nautical_twilight_end' => 1165937597,
      
'astronomical_twilight_begin' => 1165892570,
      
'astronomical_twilight_end' => 1165939380,
    ],
    
'date_sun_info' => [
      
'sunrise' => '04:29:42',
      
'sunset' => '14:36:08',
      
'transit' => '09:32:55',
      
'civil_twilight_begin' => '04:02:56',
      
'civil_twilight_end' => '15:02:53',
      
'nautical_twilight_begin' => '03:32:33',
      
'nautical_twilight_end' => '15:33:17',
      
'astronomical_twilight_begin' => '03:02:50',
      
'astronomical_twilight_end' => '16:03:00',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
'timezone' => 'UTC',
  
=> 962409600,
  
=> 50,
  
=> 50,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'array' => [
      
'sunrise' => 962411728,
      
'sunset' => 962470348,
      
'transit' => 962441038,
      
'civil_twilight_begin' => 962409089,
      
'civil_twilight_end' => 962472987,
      
'nautical_twilight_begin' => 962405247,
      
'nautical_twilight_end' => 962476829,
      
'astronomical_twilight_begin' => true,
      
'astronomical_twilight_end' => true,
    ],
    
'date_sun_info' => [
      
'sunrise' => '00:35:28',
      
'sunset' => '16:52:28',
      
'transit' => '08:43:58',
      
'civil_twilight_begin' => '23:51:29',
      
'civil_twilight_end' => '17:36:27',
      
'nautical_twilight_begin' => '22:47:27',
      
'nautical_twilight_end' => '18:40:29',
      
'astronomical_twilight_begin' => '00:00:01',
      
'astronomical_twilight_end' => '00:00:01',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]