Skip to content

Commit

Permalink
wantfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zcasper committed Mar 7, 2016
1 parent 9c3748c commit ffb88b0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
3 changes: 2 additions & 1 deletion bootstrap.php
@@ -1,7 +1,8 @@
<?php

// Get micro
require __DIR__ . '/../app/Application.php';
require __DIR__ . '/app/__autoload.php';
require __DIR__ . '/app/Application.php';

// Get kernel
$app = new \App\Application;
Expand Down
2 changes: 1 addition & 1 deletion micro/Micro.php
Expand Up @@ -111,7 +111,7 @@ public function run(IRequest $request)
throw $e;
}

return $this->doException($e); // run exception
return $this->doException($e);
}
}

Expand Down
2 changes: 2 additions & 0 deletions micro/mvc/controllers/RichController.php
Expand Up @@ -48,6 +48,8 @@ public function __construct(IContainer $container, $modules = '')
public function action($name = 'index')
{
$actionClass = false;

// check action exists
if (!method_exists($this, 'action' . ucfirst($name)) && !$actionClass = $this->getActionClassByName($name)) {
$this->response->setStatus(500, 'Action "' . $name . '" not found into ' . get_class($this));

Expand Down
7 changes: 2 additions & 5 deletions micro/mvc/views/PhpView.php
Expand Up @@ -86,11 +86,8 @@ public function render()
public function renderRawData($data = '')
{
$layoutPath = null;
if ($this->layout) {
$layoutPath = $this->getLayoutFile($this->container->kernel->getAppDir(), $this->module);
if (!$layoutPath) {
$this->container->logger->send('error', 'Layout `' . $this->layout . '` not found');
}
if ($this->layout && (!$layoutPath = $this->getLayoutFile($this->container->kernel->getAppDir(), $this->module))) {
$this->container->logger->send('error', 'Layout `' . $this->layout . '` not found');
}

if ($layoutPath) {
Expand Down
33 changes: 33 additions & 0 deletions micro/tests/HelloTest.php
@@ -0,0 +1,33 @@
<?php /** HelloTestMicro */

namespace Micro\Tests;

/**
* Class Hello test
*
* @author Oleg Lunegov <testuser@mail.linpax.org>
* @link https://github.com/lugnsk/micro
* @copyright Copyright &copy; 2013 Oleg Lunegov
* @license /LICENSE
* @package Micro
* @subpackage Tests
* @version 1.0
* @since 1.0
*/
class HelloTest extends TestCase
{
public function up()
{
//
}

public function down()
{
//
}

public function testHello()
{
$this->assertEquals('200 Ok', '200 Ok');
}
}

0 comments on commit ffb88b0

Please sign in to comment.