Skip to content
Browse files

fix zmq ext name, refactor tests, composer.json

  • Loading branch information...
1 parent 7cac965 commit 19c22d66a1c8d850ef985752429c01cb0a2f38b0 @igorw igorw committed
Showing with 49 additions and 23 deletions.
  1. +2 −0 .gitignore
  2. +1 −1 composer.json
  3. +19 −0 phpunit.xml.dist
  4. +22 −0 tests/Mongrel2/Tests/ToolTest.php
  5. +0 −22 tests/ToolsTest.php
  6. +5 −0 tests/bootstrap.php
View
2 .gitignore
@@ -0,0 +1,2 @@
+composer.lock
+vendor
View
2 composer.json
@@ -12,7 +12,7 @@
],
"require": {
"php": ">=5.3.0",
- "ext-zeromq": "*"
+ "ext-zmq": "*"
},
"autoload": {
"psr-0": {
View
19 phpunit.xml.dist
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit backupGlobals="false"
+ backupStaticAttributes="false"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ processIsolation="false"
+ stopOnFailure="false"
+ syntaxCheck="false"
+ bootstrap="tests/bootstrap.php"
+>
+ <testsuites>
+ <testsuite name="Mongrel2 Test Suite">
+ <directory>./tests/Mongrel2/</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
View
22 tests/Mongrel2/Tests/ToolTest.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Mongrel2\Tests;
+
+use Mongrel2\Tool;
+
+class ToolTest extends \PHPUnit_Framework_TestCase
+{
+ public function testHttpResponse()
+ {
+ $fix = "HTTP/1.1 200 OK\r\nX-foo: Yo\r\nContent-Length: 3\r\n\r\nfoo";
+ $ret = Tool::http_response("foo", 200, "OK", array('X-foo' => 'Yo'));
+ $this->assertEquals($ret, $fix);
+ }
+
+ public function testParseNetstring()
+ {
+ $fix = array("bar", "5:fnord,");
+ $ret = Tool::parse_netstring("3:bar,5:fnord,");
+ $this->assertEquals($ret, $fix);
+ }
+}
View
22 tests/ToolsTest.php
@@ -1,22 +0,0 @@
-<?php
-require '../m2tools.php';
-//require 'PHPUnit/Framework.php';
-
-class ToolsTest extends PHPUnit_Framework_TestCase {
-
- public function testHttpResponse() {
-
- $fix = "HTTP/1.1 200 OK\r\nX-foo: Yo\r\nContent-Length: 3\r\n\r\nfoo";
-
- $ret = \m2php\http_response("foo", 200, "OK", array('X-foo' => 'Yo'));
-
- $this->assertEquals($ret, $fix);
-
- }
- public function testParseNetstring() {
-
- $fix = array("bar", "5:fnord,");
- $ret = \m2php\parse_netstring("3:bar,5:fnord,");
- $this->assertEquals($ret, $fix);
- }
-}
View
5 tests/bootstrap.php
@@ -0,0 +1,5 @@
+<?php
+
+$loader = require __DIR__.'/../vendor/.composer/autoload.php';
+$loader->add('Mongrel2\Tests', __DIR__);
+$loader->register();

0 comments on commit 19c22d6

Please sign in to comment.
Something went wrong with that request. Please try again.