mirror of
https://github.com/ZorgCC/lumen-generators.git
synced 2025-04-14 21:22:27 +03:00
Fixing the failing build
This commit is contained in:
parent
942b8fefb4
commit
17bc595db9
@ -8,7 +8,7 @@ php:
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: 7.0
|
||||
- php: hhvm
|
||||
|
||||
sudo: false
|
||||
|
||||
|
1
lumen-test/.gitignore
vendored
1
lumen-test/.gitignore
vendored
@ -4,3 +4,4 @@
|
||||
tests/_output/*
|
||||
|
||||
composer.lock
|
||||
tests/_output/*
|
@ -1,10 +0,0 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
|
||||
class ProjectsController extends Controller {
|
||||
|
||||
const MODEL = "App\Project";
|
||||
|
||||
use RESTActions;
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
|
||||
class TagsController extends Controller {
|
||||
|
||||
const MODEL = "App\Tag";
|
||||
|
||||
use RESTActions;
|
||||
|
||||
}
|
@ -7,7 +7,7 @@ paths:
|
||||
envs: tests/_envs
|
||||
settings:
|
||||
bootstrap: _bootstrap.php
|
||||
colors: true
|
||||
colors: false
|
||||
memory_limit: 1024M
|
||||
extensions:
|
||||
enabled:
|
||||
|
@ -19,3 +19,24 @@ $factory->define(App\User::class, function ($faker) {
|
||||
'remember_token' => str_random(10),
|
||||
];
|
||||
});
|
||||
/**
|
||||
* Factory definition for model App\Task.
|
||||
*/
|
||||
$factory->define(App\Task::class, function ($faker) {
|
||||
return [
|
||||
// Fields here
|
||||
];
|
||||
});
|
||||
|
||||
/**
|
||||
* Factory definition for model App\TaskCategory.
|
||||
*/
|
||||
$factory->define(App\TaskCategory::class, function ($faker) {
|
||||
return [
|
||||
'name' => $faker->word,
|
||||
'descr' => $faker->paragraph,
|
||||
'due' => $faker->date,
|
||||
'project_id' => $faker->key,
|
||||
'user_id' => $faker->key,
|
||||
];
|
||||
});
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicExample()
|
||||
{
|
||||
$this->visit('/')
|
||||
->see('Lumen.');
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
class TestCase extends Laravel\Lumen\Testing\TestCase
|
||||
{
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return \Laravel\Lumen\Application
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
return require __DIR__.'/../bootstrap/app.php';
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
|
@ -12,7 +12,7 @@
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = null)
|
||||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] 90ca27738c5db3919bd1f5813987c735
|
||||
<?php //[STAMP] 6172d62f52ee53bf8d6f975a52df4f0d
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
@ -250,6 +250,74 @@ trait AcceptanceTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has the `number` of new lines.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeNumberNewLines(5);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param int $number New lines
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeNumberNewLines()
|
||||
*/
|
||||
public function canSeeNumberNewLines($number) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberNewLines', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks If opened file has the `number` of new lines.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->openFile('composer.json');
|
||||
* $I->seeNumberNewLines(5);
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param int $number New lines
|
||||
* @see \Codeception\Module\Filesystem::seeNumberNewLines()
|
||||
*/
|
||||
public function seeNumberNewLines($number) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberNewLines', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that contents of currently opened file matches $regex
|
||||
*
|
||||
* @param $regex
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Filesystem::seeThisFileMatches()
|
||||
*/
|
||||
public function canSeeThisFileMatches($regex) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeThisFileMatches', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that contents of currently opened file matches $regex
|
||||
*
|
||||
* @param $regex
|
||||
* @see \Codeception\Module\Filesystem::seeThisFileMatches()
|
||||
*/
|
||||
public function seeThisFileMatches($regex) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeThisFileMatches', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] ffada6587f597b23930f2f63d3309fd0
|
||||
<?php //[STAMP] 113b78942a9c8ce85a7c18397003b17c
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] c871459f363e639d6d4c21f535bb78f4
|
||||
<?php //[STAMP] afa4f0350422fae145b4236dce66191a
|
||||
namespace _generated;
|
||||
|
||||
// This class was automatically generated by build task
|
||||
@ -24,8 +24,6 @@ trait UnitTesterActions
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
* @see \Codeception\Module\Asserts::assertEquals()
|
||||
*/
|
||||
public function assertEquals($expected, $actual, $message = null) {
|
||||
@ -56,8 +54,7 @@ trait UnitTesterActions
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
* @return mixed|void
|
||||
* @see \Codeception\Module\Asserts::assertSame()
|
||||
*/
|
||||
public function assertSame($expected, $actual, $message = null) {
|
||||
@ -95,17 +92,6 @@ trait UnitTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThen()
|
||||
*/
|
||||
public function assertGreaterThen($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@ -121,17 +107,6 @@ trait UnitTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @deprecated
|
||||
* @see \Codeception\Module\Asserts::assertGreaterThenOrEqual()
|
||||
*/
|
||||
public function assertGreaterThenOrEqual($expected, $actual, $message = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@ -334,6 +309,122 @@ trait UnitTesterActions
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertGreaterOrEquals()
|
||||
*/
|
||||
public function assertGreaterOrEquals($expected, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $expected
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertLessOrEquals()
|
||||
*/
|
||||
public function assertLessOrEquals($expected, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertIsEmpty()
|
||||
*/
|
||||
public function assertIsEmpty($actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $key
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertArrayHasKey()
|
||||
*/
|
||||
public function assertArrayHasKey($key, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $key
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertArrayNotHasKey()
|
||||
*/
|
||||
public function assertArrayNotHasKey($key, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $expectedCount
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertCount()
|
||||
*/
|
||||
public function assertCount($expectedCount, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $class
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertInstanceOf()
|
||||
*/
|
||||
public function assertInstanceOf($class, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $class
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertNotInstanceOf()
|
||||
*/
|
||||
public function assertNotInstanceOf($class, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* @param $type
|
||||
* @param $actual
|
||||
* @param $description
|
||||
* @see \Codeception\Module\Asserts::assertInternalType()
|
||||
*/
|
||||
public function assertInternalType($type, $actual, $description = null) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
@ -345,4 +436,38 @@ trait UnitTesterActions
|
||||
public function fail($message) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Handles and checks exception called inside callback function.
|
||||
* Either exception class name or exception instance should be provided.
|
||||
*
|
||||
* ```php
|
||||
* <?php
|
||||
* $I->expectException(MyException::class, function() {
|
||||
* $this->doSomethingBad();
|
||||
* });
|
||||
*
|
||||
* $I->expectException(new MyException(), function() {
|
||||
* $this->doSomethingBad();
|
||||
* });
|
||||
* ```
|
||||
* If you want to check message or exception code, you can pass them with exception instance:
|
||||
* ```php
|
||||
* <?php
|
||||
* // will check that exception MyException is thrown with "Don't do bad things" message
|
||||
* $I->expectException(new MyException("Don't do bad things"), function() {
|
||||
* $this->doSomethingBad();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param $exception string or \Exception
|
||||
* @param $callback
|
||||
* @see \Codeception\Module\Asserts::expectException()
|
||||
*/
|
||||
public function expectException($exception, $callback) {
|
||||
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args()));
|
||||
}
|
||||
}
|
||||
|
@ -7,8 +7,6 @@
|
||||
class_name: AcceptanceTester
|
||||
modules:
|
||||
enabled:
|
||||
# - PhpBrowser:
|
||||
# url: http://localhost/myapp
|
||||
- \Helper\Acceptance
|
||||
- Cli
|
||||
- Filesystem
|
@ -8,7 +8,6 @@ $I->seeFileFound('./app/Http/Controllers/TestsController.php');
|
||||
$I->openFile('./app/Http/Controllers/TestsController.php');
|
||||
$I->seeFileContentsEqual('<?php namespace App\Http\Controllers;
|
||||
|
||||
|
||||
class TestsController extends Controller {
|
||||
|
||||
const MODEL = "App\\Test";
|
||||
@ -26,7 +25,6 @@ $I->seeFileFound('./app/Http/Controllers/CategoriesController.php');
|
||||
$I->openFile('./app/Http/Controllers/CategoriesController.php');
|
||||
$I->seeFileContentsEqual('<?php namespace App\Http\Controllers;
|
||||
|
||||
|
||||
class CategoriesController extends Controller {
|
||||
|
||||
const MODEL = "App\\Models\\Category";
|
||||
|
@ -72,8 +72,8 @@ $I->openFile('./database/migrations/create_tasks.php');
|
||||
$I->seeInThisFile('$table->foreign(\'category_type_id\')
|
||||
->references(\'id\')
|
||||
->on(\'category_types\');');
|
||||
$I->seeInThisFile('$table->foreign(\'user_id\')
|
||||
->references(\'identifier\')
|
||||
->on(\'members\')
|
||||
->onDelete(\'cascade\');');
|
||||
$I->seeInThisFile("\$table->foreign('user_id')
|
||||
->references('identifier')
|
||||
->on('members')
|
||||
->onDelete('cascade');");
|
||||
$I->deleteFile('./database/migrations/create_tasks.php');
|
17
lumen-test/tests/tmp/TestingModel.php
Normal file
17
lumen-test/tests/tmp/TestingModel.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php namespace Tests\Tmp;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TestingModel extends Model
|
||||
{
|
||||
protected $fillable = [];
|
||||
|
||||
protected $dates = [];
|
||||
|
||||
public static $rules = [
|
||||
// Validation rules
|
||||
];
|
||||
|
||||
// Relationships
|
||||
|
||||
}
|
@ -56,7 +56,7 @@ class FactoryCommand extends BaseCommand {
|
||||
}
|
||||
$content = implode(PHP_EOL, $content);
|
||||
} else {
|
||||
$content = "\t\t// Fields here";
|
||||
$content = " // Fields here";
|
||||
}
|
||||
|
||||
return $content;
|
||||
|
@ -66,7 +66,7 @@ class ModelCommand extends BaseCommand {
|
||||
);
|
||||
|
||||
if(empty($relations)){
|
||||
return "\t// Relationships";
|
||||
return " // Relationships";
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $relations);
|
||||
@ -99,7 +99,7 @@ class ModelCommand extends BaseCommand {
|
||||
{
|
||||
$rules = $this->option('rules');
|
||||
if(! $rules){
|
||||
return "\t\t// Validation rules";
|
||||
return " // Validation rules";
|
||||
}
|
||||
$items = $rules;
|
||||
if(! $this->option('parsed')){
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
class {{name}} extends Controller
|
||||
{
|
||||
class {{name}} extends Controller {
|
||||
|
||||
const MODEL = "{{model}}";
|
||||
|
||||
use RESTActions;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class {{name}} extends Model
|
||||
{
|
||||
class {{name}} extends Model {
|
||||
|
||||
protected $fillable = [{{fillable}}];
|
||||
|
||||
protected $dates = [{{dates}}];
|
||||
|
Loading…
x
Reference in New Issue
Block a user