Skip to content

Commit

Permalink
Merge pull request #12 from kgrzelak/dev
Browse files Browse the repository at this point in the history
phpstan
  • Loading branch information
kgrzelak authored Jun 30, 2024
2 parents 1716d2a + c35d41e commit ad5987e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: PHPStan

on:
push:
branches:
- main
paths:
- '**.php'
pull_request:
branches:
- main

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v4
with:
php-version: '8.2'
extensions: curl, zip, mbstring
coverage: none

- name: Install dependencies
run: composer install --no-progress --no-suggest

- name: Run PHPStan
run: vendor/bin/phpstan analyse --no-progress --no-interaction --memory-limit=-1 --ansi src tests
4 changes: 2 additions & 2 deletions tests/FormSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ public function testCanAddMultipleOptionsToSelect(): void
$this->assertEquals('<select name="test" class="form-select"><option value="test">Test</option><option value="test2">Test 2</option></select>', $select);
}

public function testSelectedOptionWorks()
public function testSelectedOptionWorks(): void
{
$select = LaravelForm::select()->name('test')->addOption('test', 'Test')
->addOption('test2', 'Test 2')->value('test2')->toHtml();

$this->assertEquals('<select name="test" class="form-select"><option value="test">Test</option><option value="test2" selected>Test 2</option></select>', $select);
}

public function testCanSetOptionsAsMultidimensionalArray()
public function testCanSetOptionsAsMultidimensionalArray(): void
{
$select = LaravelForm::select()->name('test')->setOptions([['value' => 'test', 'label' => 'Test'], ['value' => 'test2', 'label' => 'Test 2']]);

Expand Down

0 comments on commit ad5987e

Please sign in to comment.