diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-04-12 18:36:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 18:36:42 +0300 |
commit | 41b8240fcf79291dbabb2e30a38f321d44b64cf5 (patch) | |
tree | dcedc0ffe0210b501df733af3899ffda1146a37f /plugins/SEO | |
parent | 0e6a6ea103d4e0aa50e4912f345fb2d1da9dd58c (diff) |
Fix some UI tests (#17449)
* improve seo test
* fix map
* update expected ui files
Diffstat (limited to 'plugins/SEO')
-rw-r--r-- | plugins/SEO/tests/Integration/SEOTest.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/SEO/tests/Integration/SEOTest.php b/plugins/SEO/tests/Integration/SEOTest.php index 6c9a9d27ef..182046764b 100644 --- a/plugins/SEO/tests/Integration/SEOTest.php +++ b/plugins/SEO/tests/Integration/SEOTest.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\SEO\tests\Integration; use Piwik\DataTable\Renderer; +use Piwik\Piwik; use Piwik\Plugins\SEO\API; use Exception; use Piwik\Tests\Framework\Mock\FakeAccess; @@ -46,16 +47,13 @@ class SEOTest extends IntegrationTestCase */ public function test_API() { - try { - $dataTable = API::getInstance()->getRank('http://www.microsoft.com/'); - } catch(Exception $e) { - $this->markTestSkipped('A SEO http request failed, Skipping this test for now. Error was: '.$e->getMessage()); - } + $dataTable = API::getInstance()->getRank('http://www.microsoft.com/'); $renderer = Renderer::factory('json'); $renderer->setTable($dataTable); $ranks = json_decode($renderer->render(), true); foreach ($ranks as $rank) { - if ($rank["id"] == "alexa") { // alexa is broken at the moment + if ($rank['rank'] == Piwik::translate('General_Error')) { + $this->markTestSkipped('An exception raised when fetching data. Skipping this test for now.'); continue; } $this->assertNotEmpty($rank['rank'], $rank['id'] . ' expected non-zero rank, got [' . $rank['rank'] . ']'); |