<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
$working_copy);
}
+ protected function compareTransform($expected, $actual) {
+ $expected = str_replace('YYYY', date('Y'), $expected);
+ return parent::compareTransform($expected, $actual);
+ }
+
}
error:1:1
~~~~~~~~~~
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright YYYY Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
- private function compareTransform($expected, $actual) {
+ protected function compareTransform($expected, $actual) {
if (!strlen($expected)) {
return;
}
define($pony, 'cute');
define('pony', $cute);
define($pony, $cute);
-<div>define($pony, $cute)</div>;
~~~~~~~~~~
error:3:8 dynamic define
error:5:8 dynamic define
+++ /dev/null
-<?php
-// This test is just making sure we have undone all of the stream elision that
-// the default XHP grammar does, since it does certain transformations against
-// whitespace and entities in the lexer itself. If our parse tree elides
-// whitespace, the "+" operator trigger on the last line will patch at the wrong
-// offset and the test will fail.
-<div
- id
-
- =
-
- {
-
- $x
-
-
- }
- >
- x
-
- {
- $x
-
- }
-
- <a />
-
- &
-
- '
-
- "
-
- </div>
-
-
- ;
-
-$x+$y;
-~~~~~~~~~~
-warning:39:3
-~~~~~~~~~~
-<?php
-// This test is just making sure we have undone all of the stream elision that
-// the default XHP grammar does, since it does certain transformations against
-// whitespace and entities in the lexer itself. If our parse tree elides
-// whitespace, the "+" operator trigger on the last line will patch at the wrong
-// offset and the test will fail.
-<div
- id
-
- =
-
- {
-
- $x
-
-
- }
- >
- x
-
- {
- $x
-
- }
-
- <a />
-
- &
-
- '
-
- "
-
- </div>
-
-
- ;
-
-$x + $y;
interface i { }
-class :XhpStuff { }
+
function YY($ZZ) { }
public function vV($w_w) { }
}
-<div class="protected function">const $y;</div>;
-class :ui:lol-whatever:omg { }
+
+
function () use ($this_is_a_closure) { };
warning:5:21
warning:5:25
warning:8:11
-warning:10:7
warning:12:10
warning:12:13
warning:26:12
\ No newline at end of file
g();
if ($x) { }
else if ( $y ) { }
-<div>( a b c )</div>;
+
$obj->m(
$x,
$y,
g();
if ($x) { }
else if ($y) { }
-<div>( a b c )</div>;
+
$obj->m(
$x,
$y,
if ($x) {}
else if ($y) {}
else if ($z) {}
-<strong>if</strong>;
+
if ($x) {}
if
if ($x) {}
else if ($y) {}
else if ($z) {}
-<strong>if</strong>;
+
if ($x) {}
if ($x) {}
$a.$b;
function x($n=null) { }
function x($n = null) { }
-<div id="id">1+1=2</div>;
+
$y /* ! */ += // ?
$z;
$obj->method();
Dog::bark();
$prev = ($total == 1) ? $navids[0] : $navids[$total-1];
$next = ($total == 1) ? $navids[0] : $navids[$current+1];
-if ($x instanceof :y:z &&$w) { }
-if ($x instanceof :y:z && $w) { }
+if ($x instanceof z &&$w) { }
+if ($x instanceof z && $w) { }
~~~~~~~~~~
warning:3:3
warning:4:4
warning:11:3
warning:20:52
warning:21:54
-warning:22:24
+warning:22:21
~~~~~~~~~~
<?php
$a + $b;
$a.$b;
function x($n=null) { }
function x($n = null) { }
-<div id="id">1+1=2</div>;
+
$y /* ! */ += // ?
$z;
$obj->method();
Dog::bark();
$prev = ($total == 1) ? $navids[0] : $navids[$total - 1];
$next = ($total == 1) ? $navids[0] : $navids[$current + 1];
-if ($x instanceof :y:z && $w) { }
-if ($x instanceof :y:z && $w) { }
+if ($x instanceof z && $w) { }
+if ($x instanceof z && $w) { }