diff options
author | Anton Nizhegorodov <anizh3gorodov@gmail.com> | 2016-11-13 23:42:09 +0200 |
---|---|---|
committer | Haralan Dobrev <hkdobrev@gmail.com> | 2016-11-19 18:53:02 +0200 |
commit | 08b577c6572d8f6f0f5dcd25491b44933e36d108 (patch) | |
tree | 81f5220560a1af2f7bc3fd3ac9db837fe770a415 /tests/Monolog/Handler/SlackHandlerTest.php | |
parent | 01a2ac25a2deddea55eada54b3a92eca90215866 (diff) | |
download | monolog-08b577c6572d8f6f0f5dcd25491b44933e36d108.zip monolog-08b577c6572d8f6f0f5dcd25491b44933e36d108.tar.gz monolog-08b577c6572d8f6f0f5dcd25491b44933e36d108.tar.bz2 |
Update SlackHandler tests && allow SlackRecord formatter change after construction
Diffstat (limited to 'tests/Monolog/Handler/SlackHandlerTest.php')
-rw-r--r-- | tests/Monolog/Handler/SlackHandlerTest.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/Monolog/Handler/SlackHandlerTest.php b/tests/Monolog/Handler/SlackHandlerTest.php index a2c9879..5de7885 100644 --- a/tests/Monolog/Handler/SlackHandlerTest.php +++ b/tests/Monolog/Handler/SlackHandlerTest.php @@ -56,7 +56,10 @@ class SlackHandlerTest extends TestCase fseek($this->res, 0); $content = fread($this->res, 1024); - $this->assertRegexp('/token=myToken&channel=channel1&username=Monolog&text=&attachments=.*$/', $content); + $this->assertRegExp('/username=Monolog/', $content); + $this->assertRegExp('/channel=channel1/', $content); + $this->assertRegExp('/token=myToken/', $content); + $this->assertRegExp('/attachments/', $content); } public function testWriteContentUsesFormatterIfProvided() @@ -72,8 +75,8 @@ class SlackHandlerTest extends TestCase fseek($this->res, 0); $content2 = fread($this->res, 1024); - $this->assertRegexp('/token=myToken&channel=channel1&username=Monolog&text=test1.*$/', $content); - $this->assertRegexp('/token=myToken&channel=channel1&username=Monolog&text=foo--test2.*$/', $content2); + $this->assertRegexp('/text=test1/', $content); + $this->assertRegexp('/text=foo--test2/', $content2); } public function testWriteContentWithEmoji() @@ -83,7 +86,7 @@ class SlackHandlerTest extends TestCase fseek($this->res, 0); $content = fread($this->res, 1024); - $this->assertRegexp('/icon_emoji=%3Aalien%3A$/', $content); + $this->assertRegexp('/icon_emoji=%3Aalien%3A/', $content); } /** @@ -96,7 +99,7 @@ class SlackHandlerTest extends TestCase fseek($this->res, 0); $content = fread($this->res, 1024); - $this->assertRegexp('/color%22%3A%22'.$expectedColor.'/', $content); + $this->assertRegexp('/%5Bcolor%5D='.$expectedColor.'/', $content); } public function testWriteContentWithPlainTextMessage() |