-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
158 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: run-tests | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
php: [ 8.0, 8.1 ] | ||
laravel: [ 8.* ] | ||
dependency-version: [ prefer-stable ] | ||
include: | ||
- laravel: 8.* | ||
testbench: 6.* | ||
|
||
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | ||
coverage: none | ||
|
||
- name: Setup problem matchers | ||
run: | | ||
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
- name: Install dependencies | ||
run: | | ||
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}" | ||
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | ||
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | ||
env: | ||
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }} | ||
|
||
- name: Execute tests | ||
run: composer test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
/vendor | ||
/node_modules | ||
package-lock.json | ||
yarn.lock | ||
package-lock.json | ||
|
||
/vendor | ||
composer.phar | ||
composer.lock | ||
auth.json | ||
|
||
phpunit.xml | ||
.phpunit.result.cache | ||
|
||
.DS_Store | ||
Thumbs.db | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Compiling Assets | ||
|
||
```bash | ||
# Install npm dependencies | ||
npm install | ||
``` | ||
|
||
```bash | ||
# Compile and minify your assets: | ||
npm run prod | ||
|
||
# Compile your assets for local development: | ||
npm run dev | ||
|
||
# Run the NPM "watch" command to auto-compile your assets when they are changed: | ||
npm run watch | ||
``` | ||
|
||
## Run tests | ||
|
||
```bash | ||
composer test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.4/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">src/</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="IxDF Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace InteractionDesignFoundation\NovaHtmlCodeField\Tests; | ||
|
||
use InteractionDesignFoundation\HtmlCard\MarkdownConverter; | ||
use Illuminate\Support\Facades\App; | ||
use InteractionDesignFoundation\NovaHtmlCodeField\HtmlCode; | ||
|
||
final class HtmlCodeTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_throws_an_exception_if_invlid_template_used(): void | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
|
||
$field = new HtmlCode('any_name'); | ||
|
||
$field->previewTemplate('<p></p>'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace InteractionDesignFoundation\NovaHtmlCodeField\Tests; | ||
|
||
use InteractionDesignFoundation\NovaHtmlCodeField\ServiceProvider; | ||
use Orchestra\Testbench\TestCase as OrchestraTestCase; | ||
|
||
abstract class TestCase extends OrchestraTestCase | ||
{ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
protected function getPackageProviders($app) | ||
{ | ||
return [ | ||
ServiceProvider::class, | ||
]; | ||
} | ||
} |