Annotation of embedaddon/php/ext/standard/tests/strings/get_meta_tags.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: get_meta_tags() tests
3: --FILE--
4: <?php
5:
6: $filename = dirname(__FILE__)."/get_meta_tags.html";
7:
8: $data = <<<DATA
9: <meta name="author" content="name">
10: <meta name="keywords" content="php documentation">
11: <meta name="DESCRIPTION" content="a php manual">
12: <meta name="geo.position" content="49.33;-86.59">
13: </head> <!-- parsing stops here -->
14: DATA;
15:
16: $data1 = <<<DATA
17: <html>
18: <head>
19: <meta name="author" content="name">
20: <meta name="keywords" content="php documentation">
21: <meta name="DESCRIPTION" content="a php manual">
22: <meta name="geo.position" content="49.33;-86.59">
23: </head>
24: <body>
25: <meta name="author" content="name1">
26: <meta name="keywords" content="php documentation1">
27: <meta name="DESCRIPTION" content="a php manual1">
28: <meta name="geo.position" content="49.33;-86.591">
29: </body>
30: </html>
31: DATA;
32:
33: $data2 = <<<DATA
34: <meta name="author" content="name"
35: <meta name="keywords" content="php documentation">
36: DATA;
37:
38: $data3 = <<<DATA
39: <meta <meta name="keywords" content="php documentation">
40: DATA;
41:
42: $data4 = <<<DATA
43: <meta name="author" content="name"
44: <meta name="keywords" content="php documentation"
45: DATA;
46:
47: $array = array($data, $data1, $data2, $data3, $data4, "", "<>", "<meta<<<<<");
48:
49: foreach ($array as $html) {
50: file_put_contents($filename, $html);
51: var_dump(get_meta_tags($filename));
52: }
53:
54: @unlink($filename);
55:
56: echo "Done\n";
57: ?>
58: --EXPECTF--
59: array(4) {
60: ["author"]=>
61: string(4) "name"
62: ["keywords"]=>
63: string(17) "php documentation"
64: ["description"]=>
65: string(12) "a php manual"
66: ["geo_position"]=>
67: string(12) "49.33;-86.59"
68: }
69: array(4) {
70: ["author"]=>
71: string(4) "name"
72: ["keywords"]=>
73: string(17) "php documentation"
74: ["description"]=>
75: string(12) "a php manual"
76: ["geo_position"]=>
77: string(12) "49.33;-86.59"
78: }
79: array(1) {
80: ["keywords"]=>
81: string(17) "php documentation"
82: }
83: array(1) {
84: ["keywords"]=>
85: string(17) "php documentation"
86: }
87: array(0) {
88: }
89: array(0) {
90: }
91: array(0) {
92: }
93: array(0) {
94: }
95: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>