Permalink
Browse files

added test for version() function

  • Loading branch information...
1 parent 68426ca commit 85ce5447364467fea9710b17afac7d61a84cc320 @hm2k hm2k committed Jan 30, 2012
Showing with 31 additions and 0 deletions.
  1. +31 −0 tests/test_version.phpt
View
@@ -0,0 +1,31 @@
+--TEST--
+Test for Services_Mailman version
+--FILE--
+<?php
+
+// settings
+$testURL = 'http://mail.cpanel.net/mailman/admin';
+
+//get html
+$html=file_get_contents('mail.cpanel.net.html');
+$length=strlen($html);
+
+//set mailman
+require_once 'Services/Mailman.php';
+$mailman = new Services_Mailman($testURL,'none');
+
+//set mock
+require_once 'HTTP/Request2/Adapter/Mock.php';
+$mock = new HTTP_Request2_Adapter_Mock();
+$response= "HTTP/1.1 200 OK\r\n" .
+ "Content-Length: $length\r\n" .
+ "Connection: close\r\n" .
+ "\r\n" .
+ $html;
+$mock->addResponse($response);
+
+echo $mailman->version();
+
+?>
+--EXPECT--
+2.1.14-1

0 comments on commit 85ce544

Please sign in to comment.