diff options
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); + } + } |