Skip to content

Commit

Permalink
chore(phpunit.xml.dist): update cacheResultFile path
Browse files Browse the repository at this point in the history
- Update 'cacheResultFile' attribute in phpunit.xml.dist to 'build/phpunit/.phpunit.result.cache'
  • Loading branch information
guanguans committed Aug 15, 2023
1 parent acd0531 commit fb99fcb
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 81 deletions.
14 changes: 9 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.{vue,js,scss}]
indent_size = 2
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
[*.{yml,yaml,xml,xml.dist}]
indent_size = 2
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@
"release-patch-dry-run": "@release-patch --dry-run",
"style-fix": "@php ./vendor/bin/php-cs-fixer fix --using-cache=yes --config=.php-cs-fixer.php --ansi",
"style-lint": "@style-fix --diff --dry-run",
"test": "@php ./vendor/bin/phpunit --cache-result-file=./build/phpunit/.phpunit.result.cache --coverage-text",
"test-coverage": "@test --coverage-html=./build/phpunit/ --coverage-clover=clover.xml"
"test": "@php ./vendor/bin/phpunit --coverage-text -v",
"test-coverage": "@test --coverage-html=./build/phpunit/ --coverage-clover=clover.xml",
"test-migrate-configuration": "@test --migrate-configuration"
}
}
18 changes: 14 additions & 4 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
parameters:
ignoreErrors:
-
message: "#^PHPDoc tag @return with type Guanguans\\\\Notify\\\\Contracts\\\\MessageInterface\\|Symfony\\\\Component\\\\Mime\\\\RawMessage is not subtype of native type Guanguans\\\\Notify\\\\Contracts\\\\MessageInterface\\.$#"
message: "#^Method Guanguans\\\\Notify\\\\Clients\\\\Client\\:\\:__set\\(\\) with return type void returns \\$this\\(Guanguans\\\\Notify\\\\Clients\\\\Client\\) but should not return anything\\.$#"
count: 1
path: src/Clients/Client.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
message: "#^PHPDoc tag @return with type Guanguans\\\\Notify\\\\Contracts\\\\MessageInterface\\|Symfony\\\\Component\\\\Mime\\\\RawMessage is not subtype of native type Guanguans\\\\Notify\\\\Contracts\\\\MessageInterface\\.$#"
count: 1
path: src/Clients/Client.php

-
message: "#^Parameter \\#1 \\$message of method Symfony\\\\Component\\\\Mailer\\\\MailerInterface\\:\\:send\\(\\) expects Symfony\\\\Component\\\\Mime\\\\RawMessage, Guanguans\\\\Notify\\\\Contracts\\\\MessageInterface given\\.$#"
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
path: src/Clients/MailerClient.php
path: src/Clients/Client.php

-
message: "#^Call to an undefined method Guanguans\\\\Notify\\\\Contracts\\\\MessageInterface\\:\\:getOptions\\(\\)\\.$#"
Expand Down Expand Up @@ -50,11 +50,21 @@ parameters:
count: 1
path: src/Messages/Chanify/TextMessage.php

-
message: "#^Method Guanguans\\\\Notify\\\\Messages\\\\EmailMessage\\:\\:__set\\(\\) with return type void returns \\$this\\(Guanguans\\\\Notify\\\\Messages\\\\EmailMessage\\) but should not return anything\\.$#"
count: 1
path: src/Messages/EmailMessage.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
path: src/Messages/EmailMessage.php

-
message: "#^Method Guanguans\\\\Notify\\\\Messages\\\\Message\\:\\:__set\\(\\) with return type void returns \\$this\\(Guanguans\\\\Notify\\\\Messages\\\\Message\\) but should not return anything\\.$#"
count: 1
path: src/Messages/Message.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ includes:
# - vendor/ekino/phpstan-banned-code/extension.neon

parameters:
level: 5
level: 4
paths:
- src
tmpDir: build/phpstan
Expand Down
55 changes: 28 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
<?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"
verbose="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
cacheResultFile="build/phpunit/.phpunit.result.cache"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
verbose="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
>
<testsuites>
<testsuite name="Guanguans Test Suite">
<directory>tests/</directory>
<exclude>vendor/</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
<exclude>
<directory>src/Support</directory>
<file>src/Skeleton.php</file>
</exclude>
</whitelist>
</filter>
<testsuites>
<testsuite name="Guanguans Test Suite">
<directory>tests/</directory>
<exclude>vendor/</exclude>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
<exclude>
<directory>src/Support</directory>
<file>src/Skeleton.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>
60 changes: 30 additions & 30 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?xml version="1.0"?>
<psalm
errorLevel="4"
findUnusedVariablesAndParams="true"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
cacheDirectory="./build/psalm/"
errorBaseline="psalm-baseline.xml"
cacheDirectory="./build/psalm/"
errorBaseline="psalm-baseline.xml"
errorLevel="4"
findUnusedVariablesAndParams="true"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
<issueHandlers>
<PropertyNotSetInConstructor errorLevel="info"/>
<InvalidReturnStatement>
<errorLevel type="suppress">
<directory name="src/Clients"/>
</errorLevel>
</InvalidReturnStatement>
<UnusedClosureParam>
<errorLevel type="suppress">
<directory name="src/Messages"/>
</errorLevel>
</UnusedClosureParam>
</issueHandlers>
<plugins>
<!--<pluginClass class="Psalm\LaravelPlugin\Plugin"/>-->
</plugins>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
<issueHandlers>
<PropertyNotSetInConstructor errorLevel="info"/>
<InvalidReturnStatement>
<errorLevel type="suppress">
<directory name="src/Clients"/>
</errorLevel>
</InvalidReturnStatement>
<UnusedClosureParam>
<errorLevel type="suppress">
<directory name="src/Messages"/>
</errorLevel>
</UnusedClosureParam>
</issueHandlers>
<plugins>
<!--<pluginClass class="Psalm\LaravelPlugin\Plugin"/>-->
</plugins>
</psalm>
18 changes: 6 additions & 12 deletions tests/Feature/DingTalkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class DingTalkTest extends TestCase
{
public function testText(): void
{
// $this->expectOutputString('300001');
$this->expectOutputRegex('/^300001|130101$/');
$this->expectOutputRegex('/^300001|300005|130101$/');

$ret = Factory::dingTalk()
->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
Expand All @@ -44,8 +43,7 @@ public function testText(): void

public function testLink(): void
{
// $this->expectOutputString('300001');
$this->expectOutputRegex('/^300001|130101$/');
$this->expectOutputRegex('/^300001|300005|130101$/');

$ret = Factory::dingTalk()
->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
Expand All @@ -63,8 +61,7 @@ public function testLink(): void

public function testMarkdown(): void
{
// $this->expectOutputString('300001');
$this->expectOutputRegex('/^300001|130101$/');
$this->expectOutputRegex('/^300001|300005|130101$/');

$ret = Factory::dingTalk()
->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
Expand All @@ -83,8 +80,7 @@ public function testMarkdown(): void

public function testSingleActionCard(): void
{
// $this->expectOutputString('300001');
$this->expectOutputRegex('/^300001|130101$/');
$this->expectOutputRegex('/^300001|300005|130101$/');

$ret = Factory::dingTalk()
->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
Expand All @@ -103,8 +99,7 @@ public function testSingleActionCard(): void

public function testBtnsActionCard(): void
{
// $this->expectOutputString('300001');
$this->expectOutputRegex('/^300001|130101$/');
$this->expectOutputRegex('/^300001|300005|130101$/');

$btnsActionCardMessage = new BtnsActionCardMessage([
'title' => 'This is title(keyword).',
Expand All @@ -131,8 +126,7 @@ public function testBtnsActionCard(): void

public function testFeedCard(): void
{
// $this->expectOutputString('300001');
$this->expectOutputRegex('/^300001|130101$/');
$this->expectOutputRegex('/^300001|300005|130101$/');

$feedCardMessage = new FeedCardMessage([
'title' => 'This is title(keyword) 0.',
Expand Down

0 comments on commit fb99fcb

Please sign in to comment.