Skip to content

Commit

Permalink
adding workflow related files
Browse files Browse the repository at this point in the history
  • Loading branch information
vrkansagara committed Nov 27, 2021
1 parent 6d066b5 commit 2a57be4
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --ignore-platform-req=php

- name: Copy phpunit and phpcs files
run: cp phpcs.xml.dist phpcs.xml && cp phpunit.xml.dist phpunit.xml

- name: Run ch-check
run: composer run-script cs-check

- name: Run cs-fix
run: composer run-script cs-fix

- name: PHPUnit Test
run: composer run-script test
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
"LaraOutPress\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"LaraOutPressTest\\": "/tests/"
}
},
"support": {
"email": "vrkansagara@gmail.com",
"issues": "https://github.com/vrkansagara/LaraOutPress/issues",
Expand Down
27 changes: 27 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<ruleset name="Laminas Coding Standard">
<description>Laminas Coding Standard</description>

<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>

<!-- inherit rules from: -->
<rule ref="PSR12"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>

<!-- Paths to check -->
<file>src</file>
</ruleset>
13 changes: 13 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">./src/*</directory>
</include>
</coverage>
<testsuites>
<testsuite name="LaraOutPress Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
</phpunit>
18 changes: 18 additions & 0 deletions tests/ModuleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace LaraOutPressTest;

use PHPUnit\Framework\TestCase;

class ModuleTest extends TestCase
{
/** @test */
public function index()
{
$response = ( true === true );

$this->assertIsBool($response);
}
}

0 comments on commit 2a57be4

Please sign in to comment.