diff --git a/tests/ChatGeneratorTest.php b/tests/ChatGeneratorTest.php index 35f95af..f15fd71 100644 --- a/tests/ChatGeneratorTest.php +++ b/tests/ChatGeneratorTest.php @@ -192,19 +192,7 @@ public function test_render_simple() $this->chat->setKey('XYZ123456'); $ret = $this->chat->render(); - $expected = ""; - - $this->assertEquals($expected, $ret); + $this->assertEquals(file_get_contents(dirname(__FILE__) . '/chat_code_simple.txt'), $ret); } public function test_render_simpleOutput() @@ -216,6 +204,16 @@ public function test_render_simpleOutput() $this->expectOutputRegex('/.*window.smartsupp.*/'); } + public function test_render_async() + { + $this->chat->setKey('XYZ123456'); + $this->chat->setAsync(); + $this->chat->setAsyncDelay(2500); + $ret = $this->chat->render(); + + $this->assertEquals(file_get_contents(dirname(__FILE__) . '/chat_code_async.txt'), $ret); + } + public function test_render_allParams() { $this->chat->setKey('XYZ123456'); diff --git a/tests/chat_code.txt b/tests/chat_code.txt index 8cbe2ef..a595a46 100644 --- a/tests/chat_code.txt +++ b/tests/chat_code.txt @@ -1,6 +1,6 @@ \ No newline at end of file + \ No newline at end of file diff --git a/tests/chat_code_async.txt b/tests/chat_code_async.txt new file mode 100644 index 0000000..bae92ac --- /dev/null +++ b/tests/chat_code_async.txt @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/tests/chat_code_simple.txt b/tests/chat_code_simple.txt new file mode 100644 index 0000000..8f720cd --- /dev/null +++ b/tests/chat_code_simple.txt @@ -0,0 +1,11 @@ + \ No newline at end of file