Skip to content

Commit 4802f81

Browse files
committed
WIP
1 parent 1ddb0dd commit 4802f81

File tree

4 files changed

+95
-6
lines changed

4 files changed

+95
-6
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"require-dev": {
3333
"orchestra/testbench": "^6.0",
3434
"pestphp/pest": "^1.22",
35+
"pestphp/pest-plugin-laravel": "^1.3",
3536
"phpunit/phpunit": "^9.0"
3637
},
3738
"autoload": {
@@ -47,9 +48,8 @@
4748
}
4849
},
4950
"scripts": {
50-
"test": "vendor/bin/phpunit",
51-
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
52-
51+
"test": "vendor/bin/pest",
52+
"test-coverage": "vendor/bin/pest --coverage-html coverage"
5353
},
5454
"config": {
5555
"sort-packages": true

composer.lock

+71-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/EndpointDatabaseTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Illuminate\Support\Collection;
1111
use Illuminate\Support\Facades\Http;
1212

13-
1413
/**
1514
* Class EndpointDatabaseTest.
1615
*
@@ -28,8 +27,9 @@
2827
*/
2928

3029
it('returns a database endpoint instance', function () {
30+
3131
// TODO make tests work again, update for new Filter behaviour
32-
$endpoint = \FiveamCode\LaravelNotionApi\Notion::database('897e5a76ae524b489fdfe71f5945d1af');
32+
$endpoint = \Notion::database('897e5a76ae524b489fdfe71f5945d1af');
3333

3434
$this->assertInstanceOf(Database::class, $endpoint);
3535
});

tests/TestCase.php

+19
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,34 @@
22

33
namespace FiveamCode\LaravelNotionApi\Tests;
44

5+
use Illuminate\Database\Eloquent\Factories\Factory;
56
use Orchestra\Testbench\TestCase as Orchestra;
67
use FiveamCode\LaravelNotionApi\LaravelNotionApiServiceProvider;
78

89
class TestCase extends Orchestra
910
{
11+
protected function setUp(): void
12+
{
13+
parent::setUp();
14+
15+
Factory::guessFactoryNamesUsing(
16+
fn (string $modelName) => 'VendorName\\Skeleton\\Database\\Factories\\'.class_basename($modelName).'Factory'
17+
);
18+
}
19+
1020
protected function getPackageProviders($app)
1121
{
1222
return [
1323
LaravelNotionApiServiceProvider::class,
1424
];
1525
}
26+
public function getEnvironmentSetUp($app)
27+
{
28+
config()->set('database.default', 'testing');
29+
30+
/*
31+
$migration = include __DIR__.'/../database/migrations/create_skeleton_table.php.stub';
32+
$migration->up();
33+
*/
34+
}
1635
}

0 commit comments

Comments
 (0)