Skip to content

Commit

Permalink
Merge pull request #128 from Hikariii/feature/php7AndPhpUnit
Browse files Browse the repository at this point in the history
Test php7 and upgrade phpunit
  • Loading branch information
pitbulk committed May 16, 2016
2 parents bb979af + b7d9724 commit c09e2c8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ php:
- 5.5
- 5.4
- 5.3
- 7.0

env:
- TRAVIS=true
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Expand Up @@ -7,10 +7,10 @@
"keywords": ["saml", "saml2", "onelogin"],
"autoload": {
"classmap": [
"extlib/xmlseclibs",
"lib/Saml",
"lib/Saml2"
]
"extlib/xmlseclibs",
"lib/Saml",
"lib/Saml2"
]
},
"support": {
"email": "sixto.garcia@onelogin.com",
Expand All @@ -24,7 +24,7 @@
"ext-mcrypt": "*"
},
"require-dev": {
"phpunit/phpunit": "3.7.31",
"phpunit/phpunit": "4.8",
"satooshi/php-coveralls": "1.0.1",
"sebastian/phpcpd": "*",
"phploc/phploc": "*",
Expand All @@ -34,6 +34,6 @@
"suggest": {
"lib-openssl": "Install openssl lib in order to handle with x509 certs (require to support sign and encryption)",
"ext-mcrypt": "Install mcrypt and php5-mcrypt libs in order to support encryption",
"ext-gettext": "Install gettext and php5-gettext libs to handle translations"
"ext-gettext": "Install gettext and php5-gettext libs to handle translations"
}
}
2 changes: 1 addition & 1 deletion tests/phpunit.xml
Expand Up @@ -12,7 +12,7 @@
<logging>
<log type="coverage-html" target="./build/coverage" charset="UTF-8" yui="true" highlight="false" lowUpperBound="35" highLowerBound="70"/>
<log type="test-xml" target="./build/logfile.xml" logIncompleteSkipped="false"/>
<log type="coverage-clover" target="./build/logs/clover.xml"/>
<log type="coverage-clover" target="./build/logs/clover.xml"/>
<log type="coverage-php" target="./build/logs/coverage.cov"/>
</logging>
</phpunit>
12 changes: 8 additions & 4 deletions tests/src/OneLogin/Saml2/UtilsTest.php
Expand Up @@ -530,7 +530,7 @@ public function testParseTime2SAML()
OneLogin_Saml2_Utils::parseTime2SAML('invalidtime');
$this->assertFalse(true);
} catch (Exception $e) {
$this->assertContains('strftime() expects parameter 2 to be long', $e->getMessage());
$this->assertContains('strftime() expects parameter 2 to be', $e->getMessage());
}
}

Expand Down Expand Up @@ -647,7 +647,7 @@ public function testGenerateNameIdWithSPNameQualifier()

/**
* Tests the generateNameId method of the OneLogin_Saml2_Utils
*
*
* @covers OneLogin_Saml2_Utils::generateNameId
*/
public function testGenerateNameIdWithoutSPNameQualifier()
Expand Down Expand Up @@ -706,12 +706,14 @@ public function testDeleteLocalSession()
$this->assertTrue(isset($_SESSION['samltest']));
$this->assertTrue($_SESSION['samltest']);


OneLogin_Saml2_Utils::deleteLocalSession();
$this->assertFalse(isset($_SESSION));
$this->assertFalse(isset($_SESSION['samltest']));

$prev = error_reporting(0);
session_start();
error_reporting($prev);

$_SESSION['samltest'] = true;
OneLogin_Saml2_Utils::deleteLocalSession();
$this->assertFalse(isset($_SESSION));
Expand All @@ -733,7 +735,9 @@ public function testisSessionStarted()

$this->assertFalse(OneLogin_Saml2_Utils::isSessionStarted());

$prev = error_reporting(0);
session_start();
error_reporting($prev);

$this->assertTrue(OneLogin_Saml2_Utils::isSessionStarted());
}
Expand Down Expand Up @@ -962,7 +966,7 @@ public function testValidateSign()
$dom = new DOMDocument();
$dom->loadXML($xmlResponseMsgSigned);
$this->assertTrue(OneLogin_Saml2_Utils::validateSign($dom, $cert));

$dom->firstChild->firstChild->nodeValue = 'https://example.com/other-idp';
try {
$this->assertFalse(OneLogin_Saml2_Utils::validateSign($dom, $cert));
Expand Down

0 comments on commit c09e2c8

Please sign in to comment.