summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2016-12-08 10:34:47 +0100
committerMichal Čihař <michal@cihar.com>2016-12-08 10:35:08 +0100
commit9c22823d55d319057023dc3f559ccbe6d88881a1 (patch)
tree6bc762502978bf0ba2f12baa10084baaab1f3db3
parent5f79069a372e6e817c9989160b6f533ccf92b5a5 (diff)
downloadsql-parser-9c22823d55d319057023dc3f559ccbe6d88881a1.zip
sql-parser-9c22823d55d319057023dc3f559ccbe6d88881a1.tar.gz
sql-parser-9c22823d55d319057023dc3f559ccbe6d88881a1.tar.bz2
Document why unserialize() is needed for tests
Signed-off-by: Michal Čihař <michal@cihar.com>
-rw-r--r--tests/bootstrap.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 502763c..89b5980 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -65,6 +65,11 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
*/
public function getData($name)
{
+ /*
+ * The unrestricted unserialize() is needed here as we do have
+ * serialized objects in the tests. There should be no security risk as
+ * the test data comes with the repository.
+ */
$data = unserialize(file_get_contents('tests/data/' . $name . '.out'));
$data['query'] = file_get_contents('tests/data/' . $name . '.in');
return $data;