-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Used autoload dev for testing environment
- Loading branch information
Showing
4 changed files
with
27 additions
and
4 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 |
---|---|---|
|
@@ -36,5 +36,8 @@ | |
}, | ||
"autoload": { | ||
"classmap": ["Cronner/"] | ||
}, | ||
"autoload-dev": { | ||
"classmap": ["tests/CronnerTests/objects"] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -11,15 +11,16 @@ use Nette\Utils\DateTime; | |
use stdClass; | ||
use stekycz\Cronner\Cronner; | ||
use stekycz\Cronner\Tasks\Task; | ||
use stekycz\Cronner\tests\objects\AnotherSimpleTestObject; | ||
use stekycz\Cronner\tests\objects\NextSimpleTestObject; | ||
use stekycz\Cronner\tests\objects\SameTaskNameObject; | ||
use stekycz\Cronner\tests\objects\TestExceptionObject; | ||
use stekycz\Cronner\tests\objects\TestObject; | ||
use Tester\Assert; | ||
|
||
|
||
|
||
require_once(__DIR__ . "/bootstrap.php"); | ||
require_once(__DIR__ . "/objects/TestObject.php"); | ||
require_once(__DIR__ . "/objects/TestExceptionObject.php"); | ||
|
||
/** | ||
* @author Martin Štekl <[email protected]> | ||
|
@@ -222,6 +223,27 @@ class CronnerTest extends \TestCase | |
$this->cronner->run($now); | ||
} | ||
|
||
|
||
|
||
public function testAddingTwoTestsWithTheSameNameInOneObject() | ||
{ | ||
$self = $this; | ||
Assert::exception(function () use ($self) { | ||
$self->cronner->addTasks(new SameTaskNameObject()); | ||
}, '\stekycz\Cronner\DuplicateTaskNameException'); | ||
} | ||
|
||
|
||
|
||
public function testAddingTwoTestsWithTheSameNameInMoreObjects() | ||
{ | ||
$self = $this; | ||
Assert::exception(function () use ($self) { | ||
$self->cronner->addTasks(new AnotherSimpleTestObject()); | ||
$self->cronner->addTasks(new NextSimpleTestObject()); | ||
}, '\stekycz\Cronner\DuplicateTaskNameException'); | ||
} | ||
|
||
} | ||
|
||
run(new CronnerTest()); |
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 |
---|---|---|
|
@@ -13,7 +13,6 @@ use Tester\Assert; | |
|
||
|
||
require_once(__DIR__ . "/../bootstrap.php"); | ||
require_once(__DIR__ . "/../objects/TestObject.php"); | ||
|
||
/** | ||
* @author Martin Štekl <[email protected]> | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,6 @@ use Tester\Assert; | |
|
||
|
||
require_once(__DIR__ . "/../bootstrap.php"); | ||
require_once(__DIR__ . "/../objects/TestObject.php"); | ||
|
||
/** | ||
* @author Martin Štekl <[email protected]> | ||
|