~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/standard/tests/file/bug44034.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Bug #44034
 
3
--FILE--
 
4
<?php
 
5
 
 
6
$urls = array();
 
7
$urls[] = "data://text/plain,foo\r\nbar\r\n";
 
8
$urls[] = "data://text/plain,\r\nfoo\r\nbar\r\n";
 
9
$urls[] = "data://text/plain,foo\r\nbar";
 
10
 
 
11
foreach($urls as $url) {
 
12
        echo strtr($url, array("\r" => "\\r", "\n" => "\\n")) . "\n";
 
13
        var_dump(file($url, FILE_IGNORE_NEW_LINES));
 
14
}
 
15
?>
 
16
--EXPECTF--
 
17
data://text/plain,foo\r\nbar\r\n
 
18
array(2) {
 
19
  [0]=>
 
20
  %unicode|string%(3) "foo"
 
21
  [1]=>
 
22
  %unicode|string%(3) "bar"
 
23
}
 
24
data://text/plain,\r\nfoo\r\nbar\r\n
 
25
array(3) {
 
26
  [0]=>
 
27
  %unicode|string%(0) ""
 
28
  [1]=>
 
29
  %unicode|string%(3) "foo"
 
30
  [2]=>
 
31
  %unicode|string%(3) "bar"
 
32
}
 
33
data://text/plain,foo\r\nbar
 
34
array(2) {
 
35
  [0]=>
 
36
  %unicode|string%(3) "foo"
 
37
  [1]=>
 
38
  %unicode|string%(3) "bar"
 
39
}