Skip to content

test to gzgetss function #1479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ext/zlib/tests/gzgetss.gz
Binary file not shown.
19 changes: 19 additions & 0 deletions ext/zlib/tests/gzgetss.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
gzgetss — Get line from gz-file pointer and strip HTML tags - function
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br>
--SKIPIF--
<?php
if(!extension_loaded("zlib")){die("skip - ZLIB extension not loaded");}
?>
--FILE--
<?php
$handle = gzopen('gzgetss.gz', 'r');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always use absolute paths in PHPT (otherwise the files may not be found):

$handle = gzopen(__DIR__ . '/gzgetss.gz', 'r');

while (!gzeof($handle)){
$buffer = gzgetss($handle, 4096);
print($buffer);
}
gzclose($handle);
?>
--EXPECT--
string gzgetss(resource $zp, int $length [, string $allowable_tags ]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to make the test more meaningful by using a small HTML file for gzgetss.gz; gzgetss() is supposed to strip out any tags.