Skip to content

Commit

Permalink
Finish Alexa tests & fix test codecoverge and send to scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Clemens Sahs committed Jun 27, 2014
1 parent 9da1fe4 commit 3e8e841
Show file tree
Hide file tree
Showing 19 changed files with 9,987 additions and 34 deletions.
6 changes: 6 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
imports:
- php

tools:
external_code_coverage:
timeout: 2100
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ before_script:
- php composer.phar install --dev

script:
- ./vendor/bin/phpunit ./tests/
- cd ./tests/
- ../vendor/bin/phpunit
# - ./vendor/bin/phpcs -n --standard=PSR2 ./SEOstats/ ./tests/

after_script:
- ../vendor/bin/ocular code-coverage:upload --format=php-clover ../build/logs/clover.xml

notifications:
email: false

Expand Down
10 changes: 5 additions & 5 deletions SEOstats/Services/Alexa.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ public static function getTrafficGraph($type = 1, $url = false, $w = 660, $h = 3
/**
* @return DOMXPath
*/
private static function _getXPath($url) {
protected static function _getXPath($url) {
$url = parent::getUrl($url);
if (parent::getLastLoadedUrl() == $url && self::$_xpath) {
return self::$_xpath;
}

$html = self::_getAlexaPage($url);
$html = static::_getAlexaPage($url);
$doc = parent::_getDOMDocument($html);
$xpath = parent::_getDOMXPath($doc);

Expand All @@ -252,15 +252,15 @@ private static function _getXPath($url) {
return $xpath;
}

private static function _getAlexaPage($url)
protected static function _getAlexaPage($url)
{
$domain = Helper\Url::parseHost($url);
$dataUrl = sprintf(Config\Services::ALEXA_SITEINFO_URL, $domain);
$html = parent::_getPage($dataUrl);
$html = static::_getPage($dataUrl);
return $html;
}

private static function retInt($str)
protected static function retInt($str)
{
$strim = trim(str_replace(',', '', $str));
$intStr = 0 < strlen($strim) ? $strim : '0';
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
},
"require-dev" : {
"squizlabs/php_codesniffer" : "~1",
"phpunit/phpunit" : ">=3.7,<4"
"phpunit/phpunit" : ">=3.7,<4",
"scrutinizer/ocular" : "~1"
},
"autoload" : {
"psr-0" : {
Expand Down
Loading

0 comments on commit 3e8e841

Please sign in to comment.