-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9bb86b
commit 0948490
Showing
6 changed files
with
157 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Tonik\Gin\Foundation\Testing; | ||
|
||
use Exception; | ||
|
||
class MissingPropertyException extends Exception | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
use Tonik\Gin\Foundation\Testing\MissingPropertyException; | ||
use Tonik\Gin\Foundation\Testing\TestCase as BaseTestCase; | ||
use Tonik\Gin\Foundation\Theme; | ||
|
||
class InvalidCaseTest extends PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function it_throw_when_directory_is_not_set() { | ||
$test = new InvalidCase; | ||
|
||
$test->dir = null; | ||
|
||
$this->expectException(MissingPropertyException::class); | ||
|
||
$test->setUp(); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_throw_when_file_is_not_set() { | ||
$test = new InvalidCase; | ||
|
||
$test->file = null; | ||
|
||
$this->expectException(MissingPropertyException::class); | ||
|
||
$test->setUp(); | ||
} | ||
} | ||
|
||
class InvalidCase extends BaseTestCase | ||
{ | ||
public $file = 'file'; | ||
public $dir = 'dir'; | ||
|
||
public function createTheme() | ||
{ | ||
// | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
use Tonik\Gin\Foundation\Testing\TestCase as BaseTestCase; | ||
use Tonik\Gin\Foundation\Theme; | ||
|
||
class ValidCaseTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function setUp() { | ||
$this->test = new ValidCase; | ||
|
||
$this->test->setUp(); | ||
} | ||
|
||
public function tearDown() { | ||
$this->test->tearDown(); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_throw_when_directory_is_not_set() { | ||
$this->assertEquals($this->test->dir, __DIR__); | ||
$this->assertEquals($this->test->file, 'fixtures/file_to_autoload.php'); | ||
$this->assertInstanceOf(Theme::class, $this->test->getTheme()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_should_heve_been_setted_up() { | ||
$this->assertEquals($this->test->dir, __DIR__); | ||
$this->assertEquals($this->test->file, 'fixtures/file_to_autoload.php'); | ||
$this->assertInstanceOf(Theme::class, $this->test->getTheme()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_should_autoload_tested_source_file() { | ||
$this->assertTrue(function_exists('autoloaded_function')); | ||
$this->assertEquals('value', autoloaded_function('value')); | ||
} | ||
} | ||
|
||
class ValidCase extends BaseTestCase | ||
{ | ||
public $file = 'fixtures/file_to_autoload.php'; | ||
public $dir; | ||
|
||
public function createTheme() | ||
{ | ||
$this->dir = __DIR__; | ||
|
||
return Theme::getInstance(); | ||
} | ||
} |
File renamed without changes.