Skip to content

Commit 2d18f2d

Browse files
committed
Add test for loading the sitemap service provider and set environment values for tests.
1 parent 2237a36 commit 2d18f2d

File tree

4 files changed

+9
-53
lines changed

4 files changed

+9
-53
lines changed

database/factories/ModelFactory.php

-19
This file was deleted.

database/migrations/create_sitemap_table.php.stub

-19
This file was deleted.

tests/ExampleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
it('can test', function () {
44
expect(true)->toBeTrue();
55
});
6+
7+
it('loads the sitemap service provider', function () {
8+
$this->assertTrue(class_exists(\Fuelviews\Sitemap\SitemapServiceProvider::class));
9+
});
10+

tests/TestCase.php

+4-15
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88

99
class TestCase extends Orchestra
1010
{
11-
protected function setUp(): void
12-
{
13-
parent::setUp();
14-
15-
Factory::guessFactoryNamesUsing(
16-
fn (string $modelName) => 'Fuelviews\\Sitemap\\Database\\Factories\\'.class_basename($modelName).'Factory'
17-
);
18-
}
1911

2012
protected function getPackageProviders($app)
2113
{
@@ -24,13 +16,10 @@ protected function getPackageProviders($app)
2416
];
2517
}
2618

27-
public function getEnvironmentSetUp($app)
19+
protected function getEnvironmentSetUp($app)
2820
{
29-
config()->set('database.default', 'testing');
30-
31-
/*
32-
$migration = include __DIR__.'/../database/migrations/create_laravel-sitemap_table.php.stub';
33-
$migration->up();
34-
*/
21+
// Set environment values required for your tests
22+
$app['config']->set('app.url', 'https://localhost');
3523
}
24+
3625
}

0 commit comments

Comments
 (0)