<?php
$result = array (
- 'xmp-exif' =>
- array (
- 'CameraOwnerName' => 'Me!',
- ),
- 'xmp-general' =>
- array (
- 'LicenseUrl' => 'http://creativecommons.com/cc-by-2.9',
- 'ImageDescription' =>
- array (
- 'x-default' => 'Test image for the cc: xmp: xmpRights: namespaces in xmp',
- '_type' => 'lang',
- ),
- 'ObjectName' =>
- array (
- 'x-default' => 'xmp core/xmp rights/cc ns test',
- '_type' => 'lang',
- ),
- 'DateTimeDigitized' => '2005:04:03',
- 'Software' => 'The one true editor: Vi (ok i used gimp)',
- 'Identifier' =>
- array (
- 0 => 'http://example.com/identifierurl',
- 1 => 'urn:sha1:342524abcdef',
- '_type' => 'ul',
- ),
- 'Label' => 'Test image',
- 'DateTimeMetadata' => '2011:05:12',
- 'DateTime' => '2007:03:04 06:34:10',
- 'Nickname' => 'My little xmp test image',
- 'Rating' => '5',
- 'RightsCertificate' => 'http://example.com/rights-certificate/',
- 'Copyrighted' => 'True',
- 'CopyrightOwner' =>
- array (
- 0 => 'Bawolff is copyright owner',
- '_type' => 'ul',
- ),
- 'UsageTerms' =>
- array (
- 'x-default' => 'do whatever you want',
- 'en-gb' => 'Do whatever you want in british english',
- '_type' => 'lang',
- ),
- 'WebStatement' => 'http://example.com/web_statement',
- ),
- 'xmp-deprecated' =>
- array (
- 'Identifier' => 'http://example.com/identifierurl/wrong',
- ),
+ 'xmp-exif' =>
+ array (
+ 'CameraOwnerName' => 'Me!',
+ ),
+ 'xmp-general' =>
+ array (
+ 'LicenseUrl' => 'http://creativecommons.com/cc-by-2.9',
+ 'ImageDescription' =>
+ array (
+ 'x-default' => 'Test image for the cc: xmp: xmpRights: namespaces in xmp',
+ '_type' => 'lang',
+ ),
+ 'ObjectName' =>
+ array (
+ 'x-default' => 'xmp core/xmp rights/cc ns test',
+ '_type' => 'lang',
+ ),
+ 'DateTimeDigitized' => '2005:04:03',
+ 'Software' => 'The one true editor: Vi (ok i used gimp)',
+ 'Identifier' =>
+ array (
+ 0 => 'http://example.com/identifierurl',
+ 1 => 'urn:sha1:342524abcdef',
+ '_type' => 'ul',
+ ),
+ 'Label' => 'Test image',
+ 'DateTimeMetadata' => '2011:05:12',
+ 'DateTime' => '2007:03:04 06:34:10',
+ 'Nickname' => 'My little xmp test image',
+ 'Rating' => '5',
+ 'RightsCertificate' => 'http://example.com/rights-certificate/',
+ 'Copyrighted' => 'True',
+ 'CopyrightOwner' =>
+ array (
+ 0 => 'Bawolff is copyright owner',
+ '_type' => 'ul',
+ ),
+ 'UsageTerms' =>
+ array (
+ 'x-default' => 'do whatever you want',
+ 'en-gb' => 'Do whatever you want in british english',
+ '_type' => 'lang',
+ ),
+ 'WebStatement' => 'http://example.com/web_statement',
+ ),
+ 'xmp-deprecated' =>
+ array (
+ 'Identifier' => 'http://example.com/identifierurl/wrong',
+ ),
);
$router->add( "/$2/$1", array( 'restricted-to-y' => '$2' ), array( '$2' => 'y' ) );
foreach ( array(
- "/Foo" => array( 'title' => "Foo" ),
- "/Bar" => array( 'ping' => 'pong' ),
- "/Baz" => array( 'marco' => 'polo' ),
- "/asdf-foo" => array( 'title' => "qwerty-foo" ),
- "/qwerty-bar" => array( 'title' => "asdf-bar" ),
- "/a/Foo" => array( 'title' => "Foo" ),
- "/asdf/Foo" => array( 'title' => "Foo" ),
- "/qwerty/Foo" => array( 'title' => "Foo", 'qwerty' => 'qwerty' ),
- "/baz/Foo" => array( 'title' => "Foo", 'unrestricted' => 'baz' ),
- "/y/Foo" => array( 'title' => "Foo", 'restricted-to-y' => 'y' ),
- ) as $path => $result ) {
+ '/Foo' => array( 'title' => 'Foo' ),
+ '/Bar' => array( 'ping' => 'pong' ),
+ '/Baz' => array( 'marco' => 'polo' ),
+ '/asdf-foo' => array( 'title' => 'qwerty-foo' ),
+ '/qwerty-bar' => array( 'title' => 'asdf-bar' ),
+ '/a/Foo' => array( 'title' => 'Foo' ),
+ '/asdf/Foo' => array( 'title' => 'Foo' ),
+ '/qwerty/Foo' => array( 'title' => 'Foo', 'qwerty' => 'qwerty' ),
+ '/baz/Foo' => array( 'title' => 'Foo', 'unrestricted' => 'baz' ),
+ '/y/Foo' => array( 'title' => 'Foo', 'restricted-to-y' => 'y' ),
+ ) as $path => $result ) {
$this->assertEquals( $router->parse( $path ), $result );
}
}
*/
function escaped( $string ) {
$escaped = '';
- for ( $i = 0; $i < strlen( $string ); $i++ ) {
+ $length = strlen( $string );
+ for ( $i = 0; $i < $length; $i++ ) {
$char = $string[$i];
$val = ord( $char );
if ( $val > 127 ) {
$cases[] = array( "$base/unittest-cont1/e/b/some-other_file.txt", "more file contents" );
$cases[] = array(
array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
- "$base/unittest-cont1/e/a/z.txt" ),
+ "$base/unittest-cont1/e/a/z.txt" ),
array( "contents xx", "contents xy", "contents xz" )
);
$cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" );
$cases[] = array(
array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
- "$base/unittest-cont1/e/a/z.txt" ),
+ "$base/unittest-cont1/e/a/z.txt" ),
array( "contents xx", "contents xy", "contents xz" )
);
$cases[] = array( "$base/unittest-cont1/e/a/\$odd&.txt", "test file contents" );
$cases[] = array(
array( "$base/unittest-cont1/e/a/x.txt", "$base/unittest-cont1/e/a/y.txt",
- "$base/unittest-cont1/e/a/z.txt" ),
+ "$base/unittest-cont1/e/a/z.txt" ),
array( "contents xx", "contents xy", "contents xz" )
);