Skip to content

Commit 214c302

Browse files
committed
Initial Commit
0 parents  commit 214c302

File tree

116 files changed

+18844
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+18844
-0
lines changed

.env.example

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
APP_NAME=Laravel
2+
# APP_BASE_PATH=src
3+
APP_ENV=local
4+
APP_KEY=
5+
APP_DEBUG=true
6+
APP_URL=http://localhost
7+
8+
LOG_CHANNEL=stack
9+
LOG_LEVEL=debug
10+
11+
DB_CONNECTION=mysql
12+
DB_HOST=127.0.0.1
13+
DB_PORT=3306
14+
DB_DATABASE=db_laravel
15+
DB_USERNAME=root
16+
DB_PASSWORD=password
17+
18+
BROADCAST_DRIVER=log
19+
CACHE_DRIVER=file
20+
QUEUE_CONNECTION=sync
21+
SESSION_DRIVER=file
22+
SESSION_LIFETIME=120
23+
24+
MEMCACHED_HOST=127.0.0.1
25+
26+
REDIS_HOST=127.0.0.1
27+
REDIS_PASSWORD=null
28+
REDIS_PORT=6379
29+
30+
MAIL_MAILER=smtp
31+
MAIL_HOST=smtp.mailtrap.io
32+
MAIL_PORT=2525
33+
MAIL_USERNAME=null
34+
MAIL_PASSWORD=null
35+
MAIL_ENCRYPTION=null
36+
MAIL_FROM_ADDRESS=null
37+
MAIL_FROM_NAME="${APP_NAME}"
38+
39+
AWS_ACCESS_KEY_ID=
40+
AWS_SECRET_ACCESS_KEY=
41+
AWS_DEFAULT_REGION=us-east-1
42+
AWS_BUCKET=
43+
44+
PUSHER_APP_ID=
45+
PUSHER_APP_KEY=
46+
PUSHER_APP_SECRET=
47+
PUSHER_APP_CLUSTER=mt1
48+
49+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
50+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.env.testing

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
APP_ENV=testing
2+
APP_DEBUG=true
3+
APP_KEY=base64:VGIXsLHY+Gkt6sa/8+mNord23MKH1hx3HRfABs6ivfg=
4+
DB_CONNECTION=sqlite

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.github/workflows/laravel.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
env:
8+
APP_ENV: test
9+
10+
jobs:
11+
symfony:
12+
name: Laravel 8 (PHP ${{ matrix.php-versions }})
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
php-versions: ['7.3', '7.4', '8.0']
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2.3.4
21+
22+
- name: Setup PHP with extensions and Composer v2
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
tools: composer:v2
27+
extensions: ctype, iconv, intl, json, mbstring, pdo, pdo_sqlite
28+
env:
29+
update: true
30+
31+
- name: Get composer cache directory
32+
id: composer-cache
33+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34+
35+
- name: Cache composer dependencies
36+
uses: actions/cache@v2.1.3
37+
with:
38+
path: ${{ steps.composer-cache.outputs.dir }}
39+
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('composer.json') }}
40+
restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer-
41+
42+
- name: Install Composer dependencies
43+
run: composer update --no-progress
44+
45+
- name: Run functional tests
46+
run: |
47+
cp .env.testing .env
48+
php artisan config:cache
49+
touch database/database.sqlite
50+
php artisan migrate --seed --env=testing --force
51+
vendor/bin/codecept run Functional

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/node_modules
2+
/public/build
3+
/public/fonts
4+
/public/hot
5+
/public/storage
6+
/storage/*.key
7+
/vendor
8+
/.idea
9+
/.discovery
10+
.env
11+
.env.backup
12+
.phpunit.result.cache
13+
.phpstorm.meta.php
14+
_ide_helper.php
15+
Homestead.json
16+
Homestead.yaml
17+
npm-debug.log
18+
yarn-error.log

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Codeception Laravel Module Tests
2+
3+
[![Actions Status](https://github.com/Codeception/laravel-module-tests/workflows/CI/badge.svg)](https://github.com/Codeception/laravel-module-tests)
4+
5+
Minimal site containing functional tests for [Codeception Module Laravel](https://github.com/Codeception/module-laravel).
6+
7+
## Installation
8+
9+
1. Clone the repo:
10+
```shell
11+
git clone https://github.com/Codeception/laravel-module-tests.git
12+
```
13+
2. Install Composer dependencies:
14+
```shell
15+
composer update
16+
```
17+
3. Create your `.env` file from the `.env.testing` file.
18+
4. Create the database file: `database/database.sqlite`.
19+
5. Update database schema and load seeders:
20+
```shell
21+
php artisan migrate --seed
22+
```
23+
24+
## Usage
25+
26+
```shell
27+
vendor/bin/codecept run Functional
28+
```
29+
30+
### Create Unit Suite or Acceptance Suite
31+
32+
To create [Unit Tests](https://codeception.com/docs/05-UnitTests) or [Acceptance Tests](https://codeception.com/docs/03-AcceptanceTests), you need to create the corresponding suite first:
33+
```shell
34+
vendor/bin/codecept generate:suite Unit
35+
vendor/bin/codecept generate:suite Acceptance
36+
```
37+
<hr/>
38+
39+
> Credits to [Jan-Henk Gerritsen](https://github.com/janhenkgerritsen) for his work on [janhenkgerritsen/codeception-laravel5-sample](https://github.com/janhenkgerritsen/codeception-laravel5-sample), which served as the inspiration for this project.
40+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Console\Commands;
6+
7+
use App\Models\User;
8+
use Illuminate\Console\Command;
9+
use Illuminate\Contracts\Hashing\Hasher;
10+
11+
final class CreateUser extends Command
12+
{
13+
/** @var string */
14+
protected $signature = 'app:create-user {Name} {Email} {Password}';
15+
16+
/** @var string */
17+
protected $description = 'Create a user';
18+
19+
public function handle(): int
20+
{
21+
$name = $this->argument('Name');
22+
$email = $this->argument('Email');
23+
$password = $this->argument('Password');
24+
25+
$hasher = app()->get(Hasher::class);
26+
27+
User::factory()->createOne([
28+
'name' => $name,
29+
'email' => $email,
30+
'password' => $hasher->make($password)
31+
]);
32+
33+
$this->line('User created!');
34+
35+
return Command::SUCCESS;
36+
}
37+
}

app/Console/Kernel.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Console;
6+
7+
use App\Console\Commands\CreateUser;
8+
use Illuminate\Console\Scheduling\Schedule;
9+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
10+
use function base_path;
11+
12+
final class Kernel extends ConsoleKernel
13+
{
14+
/** @var array */
15+
protected $commands = [
16+
CreateUser::class
17+
];
18+
19+
protected function schedule(Schedule $schedule): void
20+
{
21+
// $schedule->command('inspire')->hourly();
22+
}
23+
24+
protected function commands(): void
25+
{
26+
$this->load(__DIR__.'/Commands');
27+
28+
require base_path('routes/console.php');
29+
}
30+
}

app/Events/TestEvent.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Events;
6+
7+
use Illuminate\Broadcasting\InteractsWithSockets;
8+
use Illuminate\Foundation\Events\Dispatchable;
9+
use Illuminate\Queue\SerializesModels;
10+
11+
final class TestEvent
12+
{
13+
use Dispatchable;
14+
use InteractsWithSockets;
15+
use SerializesModels;
16+
}

app/Exceptions/Handler.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Exceptions;
6+
7+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
8+
9+
final class Handler extends ExceptionHandler
10+
{
11+
/** @var array */
12+
protected $dontReport = [
13+
//
14+
];
15+
16+
/** @var array */
17+
protected $dontFlash = [
18+
'password',
19+
'password_confirmation',
20+
];
21+
22+
public function register(): void
23+
{
24+
//
25+
}
26+
}

0 commit comments

Comments
 (0)