Skip to content
This repository was archived by the owner on Aug 24, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all 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
28 changes: 28 additions & 0 deletions ext/standard/tests/streams/stream_get_filters_basic.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
stream_get_filters() basic functionality
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
User Group: PHPSP #phptestfestbrasil
--FILE--
<?php
/* Open a test file for reading and writing */
$fp = fopen('stream_test.txt', 'w+');

/* Apply the ROT13 filter to the
* write filter chain, but not the
* read filter chain */
$filter = 'string.rot13';
stream_filter_append($fp, $filter, STREAM_FILTER_WRITE);

/* Get a array with all registered filters */
$streamlist = stream_get_filters();

/* print the type from return of function stream_get_filters() */
echo gettype($streamlist) . "\n";

/* Check if the filter "string.rot13" appended earlier is included */
var_dump(in_array($filter, $streamlist));
?>
--EXPECT--
array
bool(true)
5 changes: 5 additions & 0 deletions ext/standard/tests/streams/stream_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This is a test file
This is a test file
This is a test file
This is a test file
This is a test file