summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArron Woods <aw@chartblocks.com>2015-02-11 11:24:38 +0000
committerArron Woods <aw@chartblocks.com>2015-02-11 11:24:56 +0000
commitaff709498462a699a2e93a0e7116f4321d777ade (patch)
tree9742d9bfba02c86cd9282aec849f5c4d5d6e8fe4 /tests
parent95047c4a13003400734fcd40c887c16002737590 (diff)
downloadphp-ssrs-aff709498462a699a2e93a0e7116f4321d777ade.zip
php-ssrs-aff709498462a699a2e93a0e7116f4321d777ade.tar.gz
php-ssrs-aff709498462a699a2e93a0e7116f4321d777ade.tar.bz2
Unit test for NTLM headers
Diffstat (limited to 'tests')
-rwxr-xr-xtests/library/SSRSTest/Soap/NTLMTest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/library/SSRSTest/Soap/NTLMTest.php b/tests/library/SSRSTest/Soap/NTLMTest.php
index db0970b..d7c6fd3 100755
--- a/tests/library/SSRSTest/Soap/NTLMTest.php
+++ b/tests/library/SSRSTest/Soap/NTLMTest.php
@@ -106,4 +106,40 @@ class NTLMTest extends \PHPUnit_Framework_TestCase {
->cacheWSDL('$fileContents');
}
+ public function testGenerateHeadersNoData() {
+ $ntlm = new \SSRS\Soap\NTLM('http://');
+ $headers = $ntlm->generateHeaders('http://localhost/reports/');
+
+ $this->assertEquals(array(
+ 'Method: GET',
+ 'Connection: Keep-Alive',
+ 'User-Agent: PHP-SOAP-CURL',
+ ), $headers);
+ }
+
+ public function testGenerateHeadersWithData() {
+ $ntlm = new \SSRS\Soap\NTLM('http://');
+ $headers = $ntlm->generateHeaders('http://localhost/reports/', 'data');
+
+ $this->assertEquals(array(
+ 'Method: POST',
+ 'Connection: Keep-Alive',
+ 'User-Agent: PHP-SOAP-CURL',
+ 'Content-Type: text/xml; charset=utf-8',
+ 'Content-Length: 4'
+ ), $headers);
+ }
+
+ public function testGenerateHeadersWithAction() {
+ $ntlm = new \SSRS\Soap\NTLM('http://');
+ $headers = $ntlm->generateHeaders('http://localhost/reports/', null, 'TEST');
+
+ $this->assertEquals(array(
+ 'Method: GET',
+ 'Connection: Keep-Alive',
+ 'User-Agent: PHP-SOAP-CURL',
+ 'SOAPAction: "TEST"'
+ ), $headers);
+ }
+
}