diff options
author | Urban Müller | 2018-06-19 18:18:27 +0200 |
---|---|---|
committer | Urban Müller | 2018-06-19 18:20:53 +0200 |
commit | 82ff67d50a245c09f9c7c49b2c50f17b7dc06679 (patch) | |
tree | 52a274d5b233c7f56d096cd3e43d53e136b5d6ef /tests | |
parent | 3c94c414df60719fdcf8953531cc2eb7d417ed77 (diff) | |
download | itools-82ff67d50a245c09f9c7c49b2c50f17b7dc06679.tar.gz itools-82ff67d50a245c09f9c7c49b2c50f17b7dc06679.tar.bz2 itools-82ff67d50a245c09f9c7c49b2c50f17b7dc06679.zip |
safe variants of php file funcs
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/it.t | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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"); |