All kinds of new stuff for Codeception, which isn't working at ALL

This commit is contained in:
James Cole 2014-12-06 19:47:43 +01:00
parent dbc95dd878
commit 07610ae8fb
21 changed files with 2247 additions and 17 deletions

3
.gitignore vendored
View File

@ -15,4 +15,5 @@ app/storage/firefly-export*
.vagrant
firefly-iii-import-*.json
tests/_output/*
tests/_output/*
testing.sqlite

View File

@ -0,0 +1,12 @@
<?php
return [
'driver' => 'file',
'path' => storage_path() . '/cache',
'connection' => null,
'table' => 'cache',
'memcached' => [
['host' => '127.0.0.1', 'port' => 11211, 'weight' => 100],
],
'prefix' => 'laravel',
];

View File

@ -0,0 +1,2 @@
<?php
return ['log_level' => 'debug',];

View File

@ -4,8 +4,9 @@ return [
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => ':memory:',
'database' => 'tests/_data/testing.sqlite',
'prefix' => ''
],
]
]
];

View File

@ -0,0 +1,13 @@
<?php
return [
'driver' => 'smtp',
'host' => '',
'port' => 587,
'from' => ['address' => '', 'name' => 'Firefly III'],
'encryption' => 'tls',
'username' => '',
'password' => '',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => true,
];

View File

@ -32,6 +32,7 @@ class CreateTransactionCurrenciesTable extends Migration
'transaction_currencies', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('code', 3);
}
);

View File

@ -8,7 +8,7 @@ class DefaultUserSeeder extends Seeder
public function run()
{
DB::table('users')->delete();
if (App::environment() == 'homestead') {
if (App::environment() == 'testing') {
User::create(
['email' => 'thegrumpydictator@gmail.com', 'password' => 'james', 'reset' => null, 'remember_token' => null, 'migrated' => 0]

View File

@ -7,7 +7,7 @@ class TestContentSeeder extends Seeder
public function run()
{
if (App::environment() == 'homestead') {
if (App::environment() == 'testing') {
$assetType = AccountType::whereType('Asset account')->first();
$expenseType = AccountType::whereType('Expense account')->first();

View File

@ -25,6 +25,8 @@
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- {{App::environment()}} -->
</head>
<body>
<div id="wrapper">

View File

@ -18,6 +18,8 @@
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- {{App::environment()}} -->
</head>
<body>
<div class="container">

View File

@ -93,6 +93,7 @@ Event::subscribe('FireflyIII\Event\Budget');
Event::subscribe('FireflyIII\Event\TransactionJournal');
Event::subscribe('FireflyIII\Event\Transaction');
Event::subscribe('FireflyIII\Event\Account');
Event::subscribe('FireflyIII\Event\Event');
// event that creates a relationship between transaction journals and recurring events when created.
// event that updates the relationship between transaction journals and recurring events when edited.

View File

@ -9,9 +9,23 @@ settings:
colors: true
memory_limit: 1024M
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
config:
Db:
dsn: 'sqlite:tests/_data/testing.sqlite'
user: ''
password: ''
dump:
cleanup: false
populate: false
coverage:
enabled: true
whitelist:
include:
- app/*
exclude:
- app/storage/*
blacklist:
include:
- app/controllers/*
exclude:
- app/controllers/BaseController.php

View File

@ -1,2 +1,8 @@
<?php
// This is global bootstrap for autoloading
$db = realpath(__DIR__ . '/_data') . '/testing.sqlite';
if (!file_exists($db)) {
exec('touch ' . $db);
exec('php artisan migrate --seed --env=testing');
}

View File

@ -1 +0,0 @@
/* Replace this file with actual dump of your database */

View File

@ -11,4 +11,4 @@ modules:
- AcceptanceHelper
config:
PhpBrowser:
url: 'http://localhost/myapp/'
url: 'http://firefly.app/'

View File

@ -1,4 +1,4 @@
<?php //[STAMP] 6d8b4518def1c0712832bc07010a0f73
<?php //[STAMP] 839413cdedfabfaf37368d4d42aaa8e6
// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build

View File

@ -6,4 +6,7 @@
class_name: FunctionalTester
modules:
enabled: [Filesystem, FunctionalHelper]
enabled: [Db, Filesystem, FunctionalHelper, Laravel4]
config:
Laravel4:
environment: 'testing'

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('perform actions and see result');

View File

@ -0,0 +1,7 @@
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('register a new account');
$I->amOnPage('/register');
$I->submitForm('#register', ['email' => 'noreply@gmail.com']);
$I->see('Password sent!');
$I->seeInDatabase('users', ['email' => 'noreply@gmail.com']);

View File

@ -1,4 +1,4 @@
<?php //[STAMP] c03a19ab6ad087934a18d04c48d8412a
<?php //[STAMP] edd6266044f8995765e1218f33d26102
// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build