Skip to content

Commit

Permalink
move source code to 'src' directory
Browse files Browse the repository at this point in the history
  • Loading branch information
klimov-paul committed Feb 16, 2018
1 parent 2ee6efe commit 01883a8
Show file tree
Hide file tree
Showing 64 changed files with 22 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2

matrix:
include:
Expand Down Expand Up @@ -43,7 +44,7 @@ before_script:
fi
script:
- phpunit --verbose $PHPUNIT_FLAGS
- phpunit $PHPUNIT_FLAGS

after_script:
- |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"autoload": {
"psr-4": {
"yii\\gii\\": ""
"yii\\gii\\": "src"
}
},
"extra": {
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Module.php → src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected function coreGenerators()
*/
protected function defaultVersion()
{
$packageInfo = Json::decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'composer.json'));
$packageInfo = Json::decode(file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.json'));
$extensionName = $packageInfo['name'];
if (isset(Yii::$app->extensions[$extensionName])) {
return Yii::$app->extensions[$extensionName]['version'];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions tests/GeneratorsTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
namespace yiiunit\extensions\gii;

namespace yiiunit\gii;

use yii\gii\CodeFile;
use yii\gii\generators\controller\Generator as ControllerGenerator;
Expand Down Expand Up @@ -80,7 +81,7 @@ public function testFormGenerator()
{
$generator = new FormGenerator();
$generator->template = 'default';
$generator->modelClass = 'yiiunit\extensions\gii\Profile';
$generator->modelClass = 'yiiunit\gii\Profile';
$generator->viewName = 'profile';
$generator->viewPath = '@app/runtime';

Expand All @@ -94,7 +95,7 @@ public function testCRUDGenerator()
{
$generator = new CRUDGenerator();
$generator->template = 'default';
$generator->modelClass = 'yiiunit\extensions\gii\Profile';
$generator->modelClass = 'yiiunit\gii\Profile';
$generator->controllerClass = 'app\TestController';

$valid = $generator->validate();
Expand Down
2 changes: 1 addition & 1 deletion tests/GiiTestCase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace yiiunit\extensions\gii;
namespace yiiunit\gii;

use Yii;
use yii\helpers\FileHelper;
Expand Down
2 changes: 1 addition & 1 deletion tests/ModuleTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace yiiunit\extensions\gii;
namespace yiiunit\gii;

use Yii;
use yii\gii\Module;
Expand Down
4 changes: 1 addition & 3 deletions tests/Profile.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php


namespace yiiunit\extensions\gii;

namespace yiiunit\gii;

use yii\db\ActiveRecord;

Expand Down
4 changes: 3 additions & 1 deletion tests/SchemaTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php
namespace yiiunit\extensions\gii;

namespace yiiunit\gii;

use yii\gii\generators\model\Generator as ModelGenerator;
use Yii;

/**
* SchemaTest checks that Gii model generator supports multiple schemas
* @group gii
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace yiiunit\extensions\gii;
namespace yiiunit\gii;

use yii\di\Container;
use yii\helpers\ArrayHelper;
Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require_once(__DIR__ . '/../vendor/autoload.php');
require_once(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');

Yii::setAlias('@yiiunit/extensions/gii', __DIR__);
Yii::setAlias('@yii/gii', dirname(__DIR__));
Yii::setAlias('@yiiunit/gii', __DIR__);
Yii::setAlias('@yii/gii', dirname(__DIR__) . '/src');

require_once(__DIR__ . '/compatibility.php');
4 changes: 2 additions & 2 deletions tests/generators/CrudGeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace yiiunit\extensions\gii\generators;
namespace yiiunit\gii\generators;

use yii\db\ColumnSchema;
use yii\gii\generators\crud\Generator;
use yiiunit\extensions\gii\TestCase;
use yiiunit\gii\TestCase;

class CrudGeneratorTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/generators/ModelGeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace yiiunit\extensions\gii\generators;
namespace yiiunit\gii\generators;

use yii\gii\generators\model\Generator as ModelGenerator;
use yiiunit\extensions\gii\GiiTestCase;
use yiiunit\gii\GiiTestCase;

/**
* ModelGeneratorTest checks that Gii model generator produces valid results
Expand Down

0 comments on commit 01883a8

Please sign in to comment.