Skip to content

Commit 18ea778

Browse files
committed
fix: test unity
1 parent 5e537fe commit 18ea778

9 files changed

Lines changed: 19 additions & 13 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- run: docker run -p 21:21 -p 20:20 -p 12020:12020 -p 12021:12021 -p 12022:12022 -p 12023:12023 -p 12024:12024 -p 12025:12025 -e USER=$FTP_USER -e PASS=$FTP_PASSWORD -d --name ftp papacdev/vsftpd
4646
- run: docker run -p 1080:1080 -p 1025:1025 -d --name maildev soulteary/maildev
4747
- run: docker run -p 6379:6379 -d --name redis redis
48-
- run: docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -d postgis/postgis
48+
- run: docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=postgres -e POSTGRES_PASSWORD=postgres -d postgis/postgis
4949
- run: docker run -d -p 11300:11300 schickling/beanstalkd
5050

5151
- name: Cache Composer packages

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ services:
4141
- "5432:5432"
4242
environment:
4343
POSTGRES_USER: postgres
44-
POSTGRES_PASSWORD: postgres
44+
POSTGRES_PASSWORD: password
4545
POSTGRES_DB: postgres
4646
volumes:
4747
- postgres_data:/var/lib/postgresql/data

tests/Config/stubs/database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'driver' => 'pgsql',
2020
'hostname' => "127.0.0.1",
2121
'username' => "postgres",
22-
'password' => "postgres",
22+
'password' => "password",
2323
'database' => "postgres",
2424
'charset' => "utf8",
2525
'prefix' => app_env('DB_PREFIX', ''),

tests/Config/stubs/mail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'charset' => 'utf8',
66

77
'smtp' => [
8-
'hostname' => '192.168.1.3',
8+
'hostname' => 'localhost',
99
'username' => 'test@test.dev',
1010
'password' => null,
1111
'port' => 1025,

tests/Messaging/MessagingTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace Bow\Tests\Messaging;
44

5-
use Bow\Database\Barry\Model;
5+
use Bow\View\View;
66
use Bow\Mail\Envelop;
7+
use Bow\Database\Database;
8+
use Bow\Database\Barry\Model;
9+
use PHPUnit\Framework\TestCase;
710
use Bow\Tests\Config\TestingConfiguration;
811
use Bow\Tests\Messaging\Stubs\TestMessage;
9-
use Bow\Tests\Messaging\Stubs\TestNotifiableModel;
10-
use Bow\View\View;
1112
use PHPUnit\Framework\MockObject\MockObject;
12-
use PHPUnit\Framework\TestCase;
13+
use Bow\Tests\Messaging\Stubs\TestNotifiableModel;
1314

1415
class MessagingTest extends TestCase
1516
{
@@ -22,6 +23,7 @@ public static function setUpBeforeClass(): void
2223

2324
// Initialize queue connection
2425
$config = TestingConfiguration::getConfig();
26+
Database::configure($config["database"]);
2527

2628
View::configure($config["view"]);
2729
}

tests/Support/stubs/env.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"APP_NAME": "papac"
2+
"APP_NAME": "papac",
3+
"API": {
4+
"URL": "https://localhost:8000",
5+
"KEY": "key"
6+
}
37
}

tests/Translate/TranslationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static function setUpBeforeClass(): void
1515

1616
public function test_fr_welcome_message()
1717
{
18-
$this->assertEquals(Translator::translate('welcome.message'), 'bow framework');
18+
$this->assertEquals(Translator::translate('welcome.message'), 'Bow framework');
1919
}
2020

2121
public function test_fr_user_name()
@@ -47,7 +47,7 @@ public function test_en_welcome_message()
4747
public function test_en_user_name()
4848
{
4949
Translator::setLocale("en");
50-
$this->assertEquals(Translator::translate('welcome.user.name'), 'Frank');
50+
$this->assertEquals(Translator::translate('welcome.user.name'), 'Franck');
5151
}
5252

5353
public function test_en_plurial()

tests/Translate/stubs/en/welcome.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
return [
44
'message' => 'Bow framework',
55
'user' => [
6-
'name' => 'Frank'
6+
'name' => 'Franck'
77
],
88
'plurial' => 'User|Users',
99
'hello' => 'Hello {name}'

tests/Translate/stubs/fr/welcome.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
return [
4-
'message' => 'bow framework',
4+
'message' => 'Bow framework',
55
'user' => [
66
'name' => 'Franck'
77
],

0 commit comments

Comments
 (0)