Exemplo n.º 1
0
 public function testWeeklyChartList()
 {
     try {
         $as = new Zend_Service_Audioscrobbler();
         $as->set('group', urlencode('Jazz Club'));
         $response = $as->groupGetWeeklyChartList();
         $this->assertNotNull($response);
         $this->assertNotNull($response->chart);
         $this->assertEquals($response['group'], 'Jazz Club');
         return;
     } catch (Exception $e) {
         $this->fail("Exception: [" . $e->getMessage() . "] thrown by test");
     }
 }
Exemplo n.º 2
0
    public function testPreviousWeeklyChartList()
    {
        try {
            $testing_response = $this->header . '<?xml version="1.0" encoding="UTF-8"?>
<weeklyartistchart group="Jazz Club" from="1114965332" to="1115570132">
</weeklyartistchart>
';
            $as = new Zend_Service_Audioscrobbler(TRUE, $testing_response);
            $as->set('group', urlencode('Jazz Club'));
            $from = 1114965332;
            $to = 1115570132;
            $response = $as->groupGetWeeklyChartList($from, $to);
            $this->assertNotNull(count($response));
            $this->assertEquals((string) $response['group'], 'Jazz Club');
            $this->assertEquals((int) $response['from'], $from);
            $this->assertEquals((int) $response['to'], $to);
            return;
        } catch (Exception $e) {
            $this->fail("Exception: [" . $e->getMessage() . "] thrown by test");
        }
    }