Skip to content

Commit 6a952a2

Browse files
committed
Getting tests to work for the package
1 parent 5e12d6b commit 6a952a2

File tree

4 files changed

+48
-37
lines changed

4 files changed

+48
-37
lines changed

CONTRIBUTING.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,20 @@ To get a local version working of DevDojo Auth.
3333
}
3434
```
3535

36-
Finally, run `composer update` and publish the assets:
36+
Finally, run `composer update`. Next, we need to create two symlinks
37+
38+
### Create Symlinks
39+
40+
1. From the public directory create the following symlink
41+
42+
```
43+
ln -s ../packages/devdojo/auth/public auth
44+
```
45+
46+
2. From the root directory, delete the current `tests` folder and create the following symlink
3747

3848
```
39-
php artisan vendor:publish --tag=auth:assets
49+
ln -s packages/devdojo/auth/tests tests
4050
```
4151

4252
Auth is now included in your project and is ready for development.

phpunit.xml.dist

+30-32
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3-
<testsuites>
4-
<testsuite name="Unit">
5-
<directory suffix="Test.php">./tests/Unit</directory>
6-
</testsuite>
7-
<testsuite name="Feature">
8-
<directory suffix="Test.php">./tests/Feature</directory>
9-
</testsuite>
10-
<testsuite name="Smoke">
11-
<directory suffix="Test.php">./tests/Smoke</directory>
12-
</testsuite>
13-
</testsuites>
14-
<php>
15-
<env name="APP_NAME" value="Laravel"/>
16-
<env name="APP_ENV" value="testing"/>
17-
<env name="APP_KEY" value="base64:GJqqemn+XoJxzujsDb+SMGI7rgKkpMjTj4uh8WK4hkk="/>
18-
<env name="APP_DEBUG" value="true"/>
19-
<env name="APP_TIMEZONE" value="UTC"/>
20-
<env name="APP_URL" value="https://wstw4ifdxz.sharedwithexpose.com/"/>
21-
<env name="BCRYPT_ROUNDS" value="4"/>
22-
<env name="CACHE_DRIVER" value="array"/>
23-
<env name="DB_CONNECTION" value="mysql"/>
24-
<env name="DB_DATABASE" value="auth_testing"/>
25-
<env name="MAIL_MAILER" value="array"/>
26-
<env name="QUEUE_CONNECTION" value="sync"/>
27-
<env name="SESSION_DRIVER" value="array"/>
28-
<env name="TELESCOPE_ENABLED" value="false"/>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
7+
<testsuites>
8+
<testsuite name="Unit">
9+
<directory>tests/Unit</directory>
10+
</testsuite>
11+
<testsuite name="Feature">
12+
<directory>tests/Feature</directory>
13+
</testsuite>
14+
</testsuites>
15+
<source>
16+
<include>
17+
<directory>app</directory>
18+
</include>
19+
</source>
20+
<php>
21+
<env name="APP_ENV" value="testing"/>
22+
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
23+
<env name="BCRYPT_ROUNDS" value="4"/>
24+
<env name="CACHE_STORE" value="array"/>
25+
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
26+
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
27+
<env name="MAIL_MAILER" value="array"/>
28+
<env name="PULSE_ENABLED" value="false"/>
29+
<env name="QUEUE_CONNECTION" value="sync"/>
30+
<env name="SESSION_DRIVER" value="array"/>
31+
<env name="TELESCOPE_ENABLED" value="false"/>
2932
</php>
30-
<source>
31-
<include>
32-
<directory suffix=".php">src/</directory>
33-
</include>
34-
</source>
3533
</phpunit>

tests/Feature/ExampleTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@
55

66
$response->assertStatus(200);
77
});
8+
9+
test('that the login route at /auth/login returns a successful response', function () {
10+
$response = $this->get('/auth/login');
11+
12+
$response->assertStatus(200);
13+
});

tests/Feature/LoginTest.php

-3
This file was deleted.

0 commit comments

Comments
 (0)