diff --git a/tests/_data/unserializeTest.log b/tests/_data/unserializeTest.log new file mode 100644 index 000000000..529f423d8 --- /dev/null +++ b/tests/_data/unserializeTest.log @@ -0,0 +1,3 @@ +array ( + \'email_password\' => \'$2y$10$mZs/7TJDQDS9PelsmcWZNO7Fs7hSezS1J9/wdmLRPNuFOIzjKY4Wq\', +) \ No newline at end of file diff --git a/tests/unit/e_arrayTest.php b/tests/unit/e_arrayTest.php index 49dedadbc..54b4bf1cf 100644 --- a/tests/unit/e_arrayTest.php +++ b/tests/unit/e_arrayTest.php @@ -50,8 +50,14 @@ $data = array ( */ public function testUnserialize() { - // Buggy value test. -/* + + $src = codecept_data_dir()."unserializeTest.log"; + $string_0 = file_get_contents($src); + $actual = $this->arrObj->unserialize($string_0); + $this->assertArrayHasKey('email_password', $actual); + + + // Buggy value test -------. $string_1 = "\$data = array( \'buggy_array\' => \'some value\', ); @@ -59,28 +65,21 @@ $data = array ( $actual = $this->arrObj->unserialize($string_1); $this->assertArrayHasKey('buggy_array', $actual); -*/ + // var_export format test with slashes ---- -/* $string_2 = "array(\'var_export\' => \'some value\',)"; $actual = $this->arrObj->unserialize($string_2); $this->assertArrayHasKey('var_export', $actual); -*/ + // var_export format test without slashes ---- - - - - - $string_3 = "array('var_export' => 'some value',)"; $actual = $this->arrObj->unserialize($string_3); $this->assertArrayHasKey('var_export', $actual); // json value test. - $string_4 = '{ "json": "some value" }'; $actual = $this->arrObj->unserialize($string_4); $this->assertArrayHasKey('json', $actual);