~ubuntu-branches/ubuntu/saucy/php-codesniffer/saucy

« back to all changes in this revision

Viewing changes to PHP_CodeSniffer-1.1.0/CodeSniffer/Standards/Squiz/Tests/Classes/SelfMemberReferenceUnitTest.inc

  • Committer: Bazaar Package Importer
  • Author(s): Jack Bates
  • Date: 2008-10-01 17:39:43 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081001173943-2dy06n1e8zwyw1o8
Tags: 1.1.0-1
* New upstream release
* Acknowledge NMU, thanks Jan

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
 
 
4
class SelfMemberReferenceUnitTestExample
 
5
{
 
6
 
 
7
 
 
8
    private $testCount = 0;
 
9
 
 
10
 
 
11
    private $testResults = array();
 
12
 
 
13
 
 
14
    public function SelfMemberReferenceUnitTestExample()
 
15
    {
 
16
        $testResults =& $this->testResults;
 
17
 
 
18
 
 
19
        // Correct call to self.
 
20
        $testResults[] = self::selfMemberReferenceUnitTestFunction();
 
21
        $testResults[] = parent::selfMemberReferenceUnitTestFunction();
 
22
 
 
23
        // Incorrect case.
 
24
        $testResults[] = Self::selfMemberReferenceUnitTestFunction();
 
25
        $testResults[] = SELF::selfMemberReferenceUnitTestFunction();
 
26
        $testResults[] = SelfMemberReferenceUnitTestExample::selfMemberReferenceUnitTestFunction();
 
27
 
 
28
 
 
29
        // Incorrect spacing.
 
30
        $testResults[] = self ::selfMemberReferenceUnitTestFunction();
 
31
        $testResults[] = self::  selfMemberReferenceUnitTestFunction();
 
32
        $testResults[] = self  :: selfMemberReferenceUnitTestFunction();
 
33
 
 
34
    }
 
35
 
 
36
 
 
37
    function selfMemberReferenceUnitTestFunction()
 
38
    {
 
39
        $this->testCount = $this->testCount + 1;
 
40
        return $this->testCount;
 
41
 
 
42
    }
 
43
 
 
44
 
 
45
}
 
46
 
 
47
 
 
48
?>
 
 
b'\\ No newline at end of file'