Skip to content

Commit

Permalink
PHPUnit 10 Shift (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
nie7321 authored Mar 19, 2024
1 parent ff467ad commit 60ae253
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/vendor/
/.phpunit.result.cache
/.phpunit.cache

# Logs
logs
Expand Down
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
"northwestern university",
"laravel"
],
"authors": [{
"name": "Nicholas Evans",
"email": "[email protected]"
}],
"authors": [
{
"name": "Nicholas Evans",
"email": "[email protected]"
}
],
"conflict": {
"laravel/framework": "<7.0"
},
Expand All @@ -21,7 +23,7 @@
},
"require-dev": {
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^9",
"phpunit/phpunit": "^10.0",
"php-coveralls/php-coveralls": "^2.4"
},
"autoload": {
Expand Down
14 changes: 7 additions & 7 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Test Suite">
<directory suffix=".php">./tests</directory>
<directory suffix=".php">./tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
22 changes: 12 additions & 10 deletions tests/TestProviderWorks.php → tests/Feature/TestProviderWorks.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?php

namespace Northwestern\SysDev\UI\Tests;
namespace Northwestern\SysDev\UI\Tests\Feature;

use Illuminate\Support\Str;
use Northwestern\SysDev\UI\Providers\NorthwesternUiServiceProvider;
use Northwestern\SysDev\UI\Tests\TestCase;
use PHPUnit\Framework\Attributes\Test;

class TestProviderWorks extends TestCase
final class TestProviderWorks extends TestCase
{
/** @test */
public function config_loads()
#[Test]
public function config_loads(): void
{
// Makes sure the provider is working
// It's not much, but we can't really test a huge heap of views?
$this->assertNotNull(config('northwestern-theme.lockup'));
}

/** @test */
public function renders()
#[Test]
public function renders(): void
{
$this->app['router']->get(__METHOD__, function () {
return view('northwestern::demo-styles');
Expand All @@ -28,8 +30,8 @@ public function renders()
->assertDontSee('Sentry.init');
}

/** @test */
public function sentry_configured()
#[Test]
public function sentry_configured(): void
{
$this->app['config']->set('northwestern-theme.sentry-dsn', 'sentry-dsn-mocked-value-woohoo');

Expand All @@ -44,8 +46,8 @@ public function sentry_configured()
->assertSee(config('northwestern-theme.sentry-dsn'));
}

/** @test */
public function sentry_user_context()
#[Test]
public function sentry_user_context(): void
{
$this->app['config']->set('northwestern-theme.sentry-dsn', 'sentry-dsn-mocked-value-woohoo');

Expand Down

0 comments on commit 60ae253

Please sign in to comment.