diff options
author | Arron Woods <aw@chartblocks.com> | 2015-02-11 11:24:38 +0000 |
---|---|---|
committer | Arron Woods <aw@chartblocks.com> | 2015-02-11 11:24:56 +0000 |
commit | aff709498462a699a2e93a0e7116f4321d777ade (patch) | |
tree | 9742d9bfba02c86cd9282aec849f5c4d5d6e8fe4 /tests | |
parent | 95047c4a13003400734fcd40c887c16002737590 (diff) | |
download | php-ssrs-aff709498462a699a2e93a0e7116f4321d777ade.zip php-ssrs-aff709498462a699a2e93a0e7116f4321d777ade.tar.gz php-ssrs-aff709498462a699a2e93a0e7116f4321d777ade.tar.bz2 |
Unit test for NTLM headers
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/library/SSRSTest/Soap/NTLMTest.php | 36 |
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); + } + } |