1--TEST--
2Test stream_filter_remove() function : basic functionality
3--SKIPIF--
4<?php
5$filters = stream_get_filters();
6if(! in_array( "string.rot13", $filters )) die( "skip rot13 filter not available." );
7?>
8--FILE--
9<?php
10echo "*** Testing stream_filter_remove() : basic functionality ***\n";
11
12$file = __DIR__ . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
13touch( $file );
14
15$fp = fopen( $file, 'w+' );
16
17$filter = stream_filter_append( $fp, "string.rot13", STREAM_FILTER_WRITE );
18fwrite( $fp, "Testing the rot13 filter which shifts some things around." );
19
20var_dump( stream_filter_remove( $filter ) );
21fwrite( $fp, "\nadd some more un-filtered foobar\n" );
22
23rewind( $fp );
24fpassthru( $fp );
25fclose( $fp );
26
27?>
28--CLEAN--
29<?php
30
31$file = __DIR__ . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
32unlink( $file );
33
34?>
35--EXPECT--
36*** Testing stream_filter_remove() : basic functionality ***
37bool(true)
38Grfgvat gur ebg13 svygre juvpu fuvsgf fbzr guvatf nebhaq.
39add some more un-filtered foobar
40