Development

/tools/lime/branches/2.0-experimental/test/unit/LimeAnnotationSupport/test_class_before_annotations.php

You must first sign up to be able to contribute.

root/tools/lime/branches/2.0-experimental/test/unit/LimeAnnotationSupport/test_class_before_annotations.php

Revision 20334, 1.6 kB (checked in by bschussek, 4 years ago)

Fixed a few bugs in LimeLexer? and LimeLexerAnnotations?

  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony framework.
5  *
6  * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
7  *
8  * This source file is subject to the MIT license that is bundled
9  * with this source code in the file LICENSE.
10  */
11
12 include dirname(__FILE__).'/../../bootstrap/unit.php';
13
14 LimeAnnotationSupport::enable();
15
16 class TestClassDefinition
17 {
18   public function testMethodDefinition()
19   {
20     function testNestedFunctionDefinition() {}
21
22     // test whether $this is ignored
23     $this->__toString();
24   }
25 }
26
27 class TestClassDefinitionInOneLine {}
28
29 interface TestInterfaceDefinition {}
30
31 abstract class TestAbstractClassDefinition {}
32
33 abstract class TestAbstractClassWithMethod {
34   abstract public function testMethod();
35 }
36
37 class TestExtendingClassDefinition extends TestClassDefinition {}
38
39 class TestExtendingAbstractClassDefinition extends TestAbstractClassDefinition {}
40
41 class TestImplementingClassDefinition implements TestInterfaceDefinition {}
42
43 class TestExtendingAndImplementingClassDefinition extends TestClassDefinition implements TestInterfaceDefinition {}
44
45 $t = new LimeTest(0);
46
47 // @Test
48 try
49 {
50   throw new Exception();
51 } catch (Exception $e)
52 {
53   echo "Try is not matched\n";
54 }
55
56 // @Test
57 if (false)
58 {
59 }
60 else
61 {
62   echo "If is not matched\n";
63 }
64
65 // @Test
66 // instantiate all classes to see whether they are known to PHP
67 $class = new TestClassDefinition();
68 $class = new TestClassDefinitionInOneLine();
69 $class = new TestExtendingClassDefinition();
70 $class = new TestExtendingAbstractClassDefinition();
71 $class = new TestImplementingClassDefinition();
72 $class = new TestExtendingAndImplementingClassDefinition();
73
Note: See TracBrowser for help on using the browser.