public function test_RunAllTests() { $idSite = $this->idSite; parent::test_RunAllTests(); // test delete is working as expected $goals = Piwik_Goals_API::getInstance()->getGoals($idSite); $this->assertTrue(2 == count($goals)); Piwik_Goals_API::getInstance()->deleteGoal($idSite, $this->idGoal_OneConversionPerVisit); Piwik_Goals_API::getInstance()->deleteGoal($idSite, $this->idGoal_MultipleConversionPerVisit); $goals = Piwik_Goals_API::getInstance()->getGoals($idSite); $this->assertTrue(empty($goals)); }
public function test_RunAllTests() { parent::test_RunAllTests(); $sql = "SELECT count(*) FROM " . Piwik_Common::prefixTable('log_action'); $count = Zend_Registry::get('db')->fetchOne($sql); $expected = 9; // 4 urls + 5 titles $this->assertEqual($expected, $count, "only {$expected} actions expected"); $sql = "SELECT name, url_prefix FROM " . Piwik_Common::prefixTable('log_action') . " WHERE type = " . Piwik_Tracker_Action::TYPE_ACTION_URL . " ORDER BY idaction ASC"; $urls = Zend_Registry::get('db')->fetchAll($sql); $expected = array(array('name' => 'example.org/foo/bar.html', 'url_prefix' => 0), array('name' => 'example.org/foo/bar2.html', 'url_prefix' => 3), array('name' => 'example.org/foo/bar3.html', 'url_prefix' => 1), array('name' => 'example.org/foo/bar4.html', 'url_prefix' => 2)); $this->assertEqual($expected, $urls, "normalization went wrong"); }