diff --git a/phpunit.xml b/phpunit.xml index f897107fe..b0c837272 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -11,6 +11,7 @@ ./tests/e2e/ + ./tests/unit/ \ No newline at end of file diff --git a/tests/unit/Event/EventTest.php b/tests/unit/Event/EventTest.php new file mode 100644 index 000000000..143f8b70c --- /dev/null +++ b/tests/unit/Event/EventTest.php @@ -0,0 +1,51 @@ +getServer('_APP_REDIS_HOST', ''); + $redisPort = $request->getServer('_APP_REDIS_PORT', ''); + \Resque::setBackend($redisHost.':'.$redisPort); + + $this->queue = 'v1-tests' . uniqid(); + $this->object = new Event($this->queue, 'TestsV1'); + } + + public function tearDown() + { + } + + public function testParams() + { + $this->object + ->setParam('key1', 'value1') + ->setParam('key2', 'value2') + ; + + $this->object->trigger(); + + $this->assertEquals('value1', $this->object->getParam('key1')); + $this->assertEquals('value2', $this->object->getParam('key2')); + $this->assertEquals(null, $this->object->getParam('key3')); + $this->assertEquals(\Resque::size($this->queue), 1); + } +} \ No newline at end of file