Esempio n. 1
0
 public function testValidGetFilePath()
 {
     $Repo = new NbpRepository(self::$_NbpCache);
     $test_data = [[['2015-01-02', 'c'], 'c001z150102'], [['2015-01-02', 'h'], 'h001z150102'], [['2015-01-02', 'a'], 'a001z150102'], [['2010-02-03', 'c'], 'c023z100203'], [['2010-02-03', 'h'], 'h023z100203'], [['2010-02-03', 'a'], 'a023z100203'], [['2010-02-03', 'b'], 'b005z100203'], [['2010-12-13', 'c'], 'c241z101213'], [['2010-12-13', 'h'], 'h241z101213'], [['2010-12-13', 'a'], 'a241z101213']];
     foreach ($test_data as $data) {
         $date = $data[0][0];
         $table = $data[0][1];
         $expected = "http://www.nbp.pl/kursy/xml/{$data[1]}.xml";
         $actual = $Repo->getFilePath($date, $table);
         $this->assertEquals($expected, $actual, "Failed with ({$date}, {$table})");
     }
 }