PHP Classes

File: testing/tests/TestRemoveIncludeParentheses.php

Recommend this page to a friend!
  Classes of Subin Siby   PHPF   testing/tests/TestRemoveIncludeParentheses.php   Download  
File: testing/tests/TestRemoveIncludeParentheses.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHPF
Reformat PHP scripts according to code style
Author: By
Last change: Update of testing/tests/TestRemoveIncludeParentheses.php
Date: 7 years ago
Size: 726 bytes
 

Contents

Class file image Download
<?php

class TestRemoveIncludeParentheses extends PHPUnit_Framework_TestCase {

   
/**
     * @var string Code to test
     */
   
private $code = <<<CODE
<?php
include ('a.php');
require ('a.php');
?>
CODE;

    public function
testEnabled() {
       
$output = executeCommand(
            array(
               
'--passes' => 'RemoveIncludeParentheses',
            ),
           
$this->code
       
);

       
$this->assertContains( "include 'a.php';", $output );
       
$this->assertContains( "require 'a.php';", $output );
    }

    public function
testDisabled() {
       
$output = executeCommand(
            array(
               
'--exclude' => 'RemoveIncludeParentheses',
            ),
           
$this->code
       
);

       
$this->assertContains( "include ('a.php');", $output );
       
$this->assertContains( "require ('a.php');", $output );
    }

}