From 82ff67d50a245c09f9c7c49b2c50f17b7dc06679 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 19 Jun 2018 18:18:27 +0200 Subject: safe variants of php file funcs --- tests/it.t | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/it.t b/tests/it.t index 0da8768..ef3dfdb 100755 --- a/tests/it.t +++ b/tests/it.t @@ -465,3 +465,11 @@ is(it::split("b", "ababa", ['limit' => 2]), ["a", "aba"]); is(it::split("b", "abbba", ['no_empty' => true]), ["a", "a"]); is(it::split("(b)", "aba", ['delim_capture' => true]), ["a", "b", "a"]); is(it::split("b", "aabaa", ['offset_capture' => true]), [["aa", 0], ["aa", 3]]); + +it::file_put_contents("/tmp/it_test", "aa"); +is(($fh = fopen("/tmp/it_test", "r")) ? fgets($fh) : null, "aa"); +is(it::file_get_contents("/tmp/it_test"), "aa"); +is(it::file("/tmp/it_test"), ["aa"]); + +it::file_put("/tmp/it_test", "bb"); +is(it::file_get("/tmp/it_test"), "bb"); -- cgit v1.2.3