Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
More unit tests (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
edsonmedina committed Feb 8, 2015
1 parent 5777d03 commit 569644c
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Issues/ExternalClassConstantFetchIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\ExternalClassConstantFetchIssue;

class ExternalClassConstantFetchIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\ExternalClassConstantFetchIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Stmt\Class_')
->disableOriginalConstructor()
->getMock();

$issue = new ExternalClassConstantFetchIssue ($node);

$this->assertEquals('External class constant fetch', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/FinalClassIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\FinalClassIssue;

class FinalClassIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\FinalClassIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Stmt\Class_')
->disableOriginalConstructor()
->getMock();

$issue = new FinalClassIssue ($node);

$this->assertEquals('Final class declaration', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/FinalMethodIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\FinalMethodIssue;

class FinalMethodIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\FinalMethodIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Stmt\ClassMethod')
->disableOriginalConstructor()
->getMock();

$issue = new FinalMethodIssue ($node);

$this->assertEquals('Final method declaration', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/GlobalFunctionCallIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\GlobalFunctionCallIssue;

class GlobalFunctionCallIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\GlobalFunctionCallIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Stmt\Function_')
->disableOriginalConstructor()
->getMock();

$issue = new GlobalFunctionCallIssue ($node);

$this->assertEquals('Global function call', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/NewInstanceIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\NewInstanceIssue;

class NewInstanceIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\NewInstanceIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Expr\New_')
->disableOriginalConstructor()
->getMock();

$issue = new NewInstanceIssue ($node);

$this->assertEquals('New instance', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/PrivateMethodIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\PrivateMethodIssue;

class PrivateMethodIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\PrivateMethodIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Stmt\ClassMethod')
->disableOriginalConstructor()
->getMock();

$issue = new PrivateMethodIssue ($node);

$this->assertEquals('Private method declaration', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/ProtectedMethodIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\ProtectedMethodIssue;

class ProtectedMethodIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\ProtectedMethodIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Stmt\ClassMethod')
->disableOriginalConstructor()
->getMock();

$issue = new ProtectedMethodIssue ($node);

$this->assertEquals('Protected method declaration', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/StaticMethodCallIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\StaticMethodCallIssue;

class StaticMethodCallIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\StaticMethodCallIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Stmt\ClassMethod')
->disableOriginalConstructor()
->getMock();

$issue = new StaticMethodCallIssue ($node);

$this->assertEquals('Static method call', $issue->getTitle());
}
}
22 changes: 22 additions & 0 deletions tests/Issues/StaticPropertyFetchIssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

require_once __DIR__.'/../../vendor/autoload.php';

use edsonmedina\php_testability\Issues\StaticPropertyFetchIssue;

class StaticPropertyFetchIssueTest extends PHPUnit_Framework_TestCase
{
/**
* @covers edsonmedina\php_testability\Issues\StaticPropertyFetchIssue::getTitle
*/
public function testGetTitle ()
{
$node = $this->getMockBuilder('PhpParser\Node\Expr\StaticPropertyFetch')
->disableOriginalConstructor()
->getMock();

$issue = new StaticPropertyFetchIssue ($node);

$this->assertEquals('Static property fetch', $issue->getTitle());
}
}

0 comments on commit 569644c

Please sign in to comment.