[icinga-checkins] icinga.org: icingaweb2/bugfix/ ini-writer-must-not-persist-section-keys-with-a-null-value-11743: IniWriterTest: make recently added tests more expressive

git at icinga.org git at icinga.org
Mon Oct 17 14:13:38 CEST 2016


Module: icingaweb2
Branch: bugfix/ini-writer-must-not-persist-section-keys-with-a-null-value-11743
Commit: 99866bfdbea99667ff7cf5bf27dfbbbb7efd5d05
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=99866bfdbea99667ff7cf5bf27dfbbbb7efd5d05

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Mon Oct 17 13:51:58 2016 +0200

IniWriterTest: make recently added tests more expressive

refs #11743

---

 test/php/library/Icinga/File/Ini/IniWriterTest.php |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/test/php/library/Icinga/File/Ini/IniWriterTest.php b/test/php/library/Icinga/File/Ini/IniWriterTest.php
index e4bfd27..9e38aa9 100644
--- a/test/php/library/Icinga/File/Ini/IniWriterTest.php
+++ b/test/php/library/Icinga/File/Ini/IniWriterTest.php
@@ -409,9 +409,9 @@ EOD;
         $config->setSection('garbage', $section);
 
         $iniWriter = new IniWriter($config, '/dev/null');
-        $this->assertEquals(
-            0,
-            preg_match('/foobar/', $iniWriter->render()),
+        $this->assertNotContains(
+            'foobar',
+            $iniWriter->render(),
             'IniWriter persists section keys with null values'
         );
     }
@@ -424,9 +424,9 @@ EOD;
         $config->setSection('garbage', $section);
 
         $iniWriter = new IniWriter($config, '/dev/null');
-        $this->assertEquals(
-            1,
-            preg_match('/foobar/', $iniWriter->render()),
+        $this->assertContains(
+            'foobar',
+            $iniWriter->render(),
             'IniWriter doesn\'t persist section keys with empty values'
         );
     }
@@ -441,9 +441,9 @@ EOD;
         $section = $config->getSection('garbage');
         $section->foobar = null;
         $iniWriter = new IniWriter($config, $filename);
-        $this->assertEquals(
-            0,
-            preg_match('/foobar/', $iniWriter->render()),
+        $this->assertNotContains(
+            'foobar',
+            $iniWriter->render(),
             'IniWriter doesn\'t remove section keys with null values'
         );
 



More information about the icinga-checkins mailing list