Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Jan 15, 2016
1 parent 859856b commit 44cdcf4
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 186 deletions.
6 changes: 2 additions & 4 deletions src/controllers/InitController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*/
class InitController extends TemplateController
{
use \hiqdev\yii2\collection\ObjectTrait;

protected $_file = '.hidev/config.yml';

public $vendor;
Expand Down Expand Up @@ -76,11 +74,11 @@ public function getNick()

public function getAuthor()
{
return $this->getItem('author') ?: $this->getVcs()->getUserName();
return $this->getItem('author') ?: $this->takeVcs()->getUserName();
}

public function getEmail()
{
return $this->getItem('email') ?: $this->getVcs()->getUserEmail();
return $this->getItem('email') ?: $this->takeVcs()->getUserEmail();
}
}
51 changes: 51 additions & 0 deletions tests/unit/controllers/FileControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

/*
* Task runner, code generator and build tool for easier continuos integration
*
* @link https://github.com/hiqdev/hidev
* @package hidev
* @license BSD-3-Clause
* @copyright Copyright (c) 2014-2016, HiQDev (http://hiqdev.com/)
*/

namespace hidev\tests\unit\controllers;

use hidev\controllers\FileController;

/**
* Tests from FileController.
*/
class FileControllerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var FileController
*/
protected $object;

protected $template = 'asd';

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->object = new FileController('test', null);
}

/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}

public function testSetTemplate()
{
$this->object->setTemplate($this->template);
$this->assertSame($this->template, $this->object->getTemplate());
}

}
182 changes: 0 additions & 182 deletions tests/unit/goals/FileGoalTest.php

This file was deleted.

0 comments on commit 44cdcf4

Please sign in to comment.