-
Notifications
You must be signed in to change notification settings - Fork 1
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
Falaleev Maxim
committed
Oct 17, 2014
1 parent
3177196
commit 84ae1d3
Showing
11 changed files
with
118 additions
and
13 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,12 @@ | ||
<?php | ||
|
||
namespace Mindy\Application\Tests; | ||
|
||
use Mindy\Application\BaseApplication; | ||
|
||
class Application extends BaseApplication | ||
{ | ||
public function processRequest() | ||
{ | ||
} | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace Mindy\Application\Tests; | ||
|
||
class ApplicationTest extends TestCase | ||
{ | ||
public function testSimple() | ||
{ | ||
$config = [ | ||
'basePath' => __DIR__ . '/../../app', | ||
'params' => [ | ||
'foo' => 'bar' | ||
], | ||
]; | ||
$app = new Application($config); | ||
|
||
// Unique id test | ||
$this->assertNotNull($app->getId()); | ||
|
||
// Base paths test | ||
$this->assertEquals(realpath(__DIR__ . '/../../app'), $app->getBasePath()); | ||
$this->assertEquals(realpath(__DIR__ . '/../../app/Modules'), $app->getModulePath()); | ||
$this->assertEquals(realpath(__DIR__ . '/../../app/runtime'), $app->getRuntimePath()); | ||
|
||
// Params test | ||
$this->assertEquals(['foo' => 'bar'], $app->getParams()->all()); | ||
|
||
// Timezones test | ||
$this->assertEquals(date_default_timezone_get(), $app->getTimeZone()); | ||
$app->setTimeZone('UTC'); | ||
$this->assertEquals('UTC', $app->getTimeZone()); | ||
|
||
// Test Translate component | ||
$this->assertInstanceOf('\Mindy\Locale\Translate', $app->getTranslate()); | ||
} | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Mindy\Application\Tests; | ||
|
||
use PHPUnit_Framework_TestCase; | ||
|
||
class TestCase extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
} | ||
|
Empty file.
Empty file.
Empty file.
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,5 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
require_once __DIR__ . '/TestCase.php'; | ||
require_once __DIR__ . '/Application.php'; |
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,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="true" | ||
syntaxCheck="true" | ||
bootstrap="Tests/bootstrap.php" | ||
> | ||
|
||
<php> | ||
<ini name="memory_limit" value="-1"/> | ||
<ini name="display_errors" value="1"/> | ||
<ini name="error_reporting" value="-1"/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="Application"> | ||
<directory>./Tests/Cases/Application/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<groups> | ||
<exclude> | ||
<group>benchmark</group> | ||
</exclude> | ||
</groups> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<!--<log type="coverage-html" target="build/logs/coverage" charset="UTF-8"--> | ||
<!--yui="true" highlight="true" lowUpperBound="50" highLowerBound="80"/>--> | ||
</logging> | ||
</phpunit> |
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