Skip to content

Commit

Permalink
Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
jn-jairo committed Mar 14, 2024
1 parent 9ab8394 commit 6bfe611
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 37 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG-3.x.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## [Unreleased](https://github.com/jn-jairo/laravel-ngrok/compare/v3.0.1...3.x)
## [Unreleased](https://github.com/jn-jairo/laravel-ngrok/compare/v3.0.2...3.x)

## [v3.0.2 (2024-03-14)](https://github.com/jn-jairo/laravel-ngrok/compare/v3.0.1...v3.0.2)

### Added
- Laravel 11 support

## [v3.0.1 (2023-04-12)](https://github.com/jn-jairo/laravel-ngrok/compare/v3.0.0...v3.0.1)

Expand Down
45 changes: 37 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ STABLE_DEPS += '8.1|9.0|7.0'
STABLE_DEPS += '8.1|10.0|8.0'
STABLE_DEPS += '8.2|9|7.0'
STABLE_DEPS += '8.2|10.0|8.0'
STABLE_DEPS += '8.2|11.0|9.0'
STABLE_DEPS += '8.3|10.0|8.0'
STABLE_DEPS += '8.3|11.0|9.0'

# php_version|laravel_version|orchestra_version
LOWEST_DEPS += '8.1|8.83|6.24'
LOWEST_DEPS += '8.1|9.0|7.0'
LOWEST_DEPS += '8.1|10.0|8.0'
LOWEST_DEPS += '8.2|9|7.0'
LOWEST_DEPS += '8.2|10.0|8.0'
LOWEST_DEPS += '8.2|11.0|9.0'
LOWEST_DEPS += '8.3|10.0|8.0'
LOWEST_DEPS += '8.3|11.0|9.0'

define show_title
title=$1 ; \
Expand All @@ -28,6 +34,10 @@ define composer_update
composer update --prefer-dist --no-interaction --prefer-stable
endef

define clean_cache
(rm -r .phpunit.cache > /dev/null 2>&1 || true) ;
endef

define test_version
versions="$1" ; \
composer_args=$2 ; \
Expand All @@ -36,6 +46,7 @@ define test_version
orchestra_version=$$(echo $${versions} | cut -d'|' -f 3); \
if command -v php$${php_version} > /dev/null 2>&1 ; \
then \
$(call clean_cache) \
$(call show_title,'PHP: '$${php_version}' LARAVEL: '$${laravel_version}' ORCHESTRA: '$${orchestra_version}) \
echo -n 'Updating dependencies... ' ; \
output_composer=$$(php$${php_version} $$(which composer) update --prefer-dist --no-interaction $${composer_args} --prefer-stable --with=laravel/framework:^$${laravel_version} --with=orchestra/testbench:^$${orchestra_version} --with=orchestra/testbench-core:^$${orchestra_version} 2>&1) ; \
Expand All @@ -56,6 +67,7 @@ define test_version
continue ; \
fi; \
echo 'OK' ; \
$(call clean_cache) \
fi;
endef

Expand All @@ -66,60 +78,70 @@ fast: parallel-test code-fix code-style
slow: parallel-test code-fix code-style static-analysis

.PHONY: coverage
coverage: test-coverage infection-test
coverage: test-coverage

.PHONY: coverage-show
coverage-show: test-coverage infection-test show-coverage show-infection
coverage-show: test-coverage show-coverage

.PHONY: composer-update
composer-update:
@$(call composer_update)

.PHONY: test
test:
@$(call clean_cache)
@$(call show_title,'TEST') \
vendor/bin/pest \
--do-not-cache-result \
$(ARGS)
@$(call clean_cache)

.PHONY: test-coverage
test-coverage: clean-coverage
@$(call clean_cache)
@$(call show_title,'TEST COVERAGE') \
XDEBUG_MODE=coverage \
php -d zend_extension=xdebug.so \
vendor/bin/pest \
--configuration phpunit-coverage.xml \
--do-not-cache-result \
--coverage
@$(call clean_cache)

.PHONY: test-stable
test-stable:
@$(call clean_cache)
@$(call show_title,'TEST STABLE') \
for versions in $(STABLE_DEPS) ; \
do \
$(call test_version,$${versions}) \
done; \
$(call composer_update) > /dev/null 2>&1
@$(call clean_cache)

.PHONY: test-lowest
test-lowest:
@$(call clean_cache)
@$(call show_title,'TEST LOWEST') \
for versions in $(LOWEST_DEPS) ; \
do \
$(call test_version,$${versions},--prefer-lowest) \
done; \
$(call composer_update) > /dev/null 2>&1
@$(call clean_cache)

.PHONY: parallel-test
parallel-test:
@$(call clean_cache)
@$(call show_title,'PARALLEL TEST') \
vendor/bin/pest \
--parallel \
--processes=$(shell nproc) \
--passthru="--do-not-cache-result"
--processes=$(shell nproc)
@$(call clean_cache)

.PHONY: parallel-test-coverage
parallel-test-coverage: clean-coverage
@$(call clean_cache)
@$(call show_title,'PARALLEL TEST COVERAGE') \
XDEBUG_MODE=coverage \
php -d zend_extension=xdebug.so \
Expand All @@ -128,17 +150,19 @@ parallel-test-coverage: clean-coverage
--processes=$(shell nproc) \
--configuration=phpunit-coverage.xml \
--passthru-php="-d zend_extension=xdebug.so" \
--passthru="--do-not-cache-result" \
--coverage
@$(call clean_cache)

.PHONY: infection-test
infection-test: clean-infection
@$(call clean_cache)
@$(call show_title,'INFECTION TEST') \
infection \
--threads=$(shell nproc) \
--coverage=build/coverage \
--skip-initial-tests \
--test-framework=pest
@$(call clean_cache)

.PHONY: code-fix
code-fix:
Expand All @@ -165,14 +189,19 @@ show-infection:
@xdg-open build/infection/infection.html > /dev/null 2>&1

.PHONY: clean
clean: clean-coverage clean-infection
clean: clean-cache clean-coverage clean-infection

.PHONY: clean-cache
clean-cache:
@$(call show_title,'CLEAN CACHE') \
(rm -r .phpunit.cache > /dev/null 2>&1 || true)

.PHONY: clean-coverage
clean-coverage:
@$(call show_title,'CLEAR COVERAGE') \
@$(call show_title,'CLEAN COVERAGE') \
(rm -r build/coverage > /dev/null 2>&1 || true)

.PHONY: clean-infection
clean-infection:
@$(call show_title,'CLEAR INFECTION') \
@$(call show_title,'CLEAN INFECTION') \
(rm -r build/infection > /dev/null 2>&1 || true)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This package allows you to share your Laravel application with [ngrok](https://n
8.x | 2.x
9.x | 2.x
10.x | 3.x
11.x | 3.x

## Installation

Expand Down
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
"require": {
"php": "^8.1",
"guzzlehttp/guzzle": "^6.5.8|^7.4.5",
"illuminate/console": "^8.83|^9.0|^10.0",
"illuminate/http": "^8.83|^9.0|^10.0",
"illuminate/pagination": "^8.83|^9.0|^10.0",
"illuminate/routing": "^8.83|^9.0|^10.0",
"illuminate/support": "^8.83|^9.0|^10.0",
"symfony/process": "^5.4|^6.0"
"illuminate/console": "^8.83|^9.0|^10.0|^11.0",
"illuminate/http": "^8.83|^9.0|^10.0|^11.0",
"illuminate/pagination": "^8.83|^9.0|^10.0|^11.0",
"illuminate/routing": "^8.83|^9.0|^10.0|^11.0",
"illuminate/support": "^8.83|^9.0|^10.0|^11.0",
"symfony/process": "^5.4|^6.0|^7.0"
},
"require-dev": {
"orchestra/testbench": "^6.24|^7.0|^8.0",
"pestphp/pest": "^1.22",
"pestphp/pest-plugin-parallel": "^1.2",
"orchestra/testbench": "^6.24|^7.0|^8.0|^9.0",
"pestphp/pest": "^1.22|^2.34",
"phpspec/prophecy": "^1.17",
"phpspec/prophecy-phpunit": "^2.0",
"webmozart/assert": "^1.11"
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
- src
- tests
ignoreErrors:
- '#Call to an undefined method Pest\\Expectation\\|Pest\\Support\\Extendable::#'
- '#Call to an undefined method Pest\\PendingCalls\\TestCall\|Pest\\Support\\HigherOrderTapProxy::#'
- '#Cannot access offset .* on mixed#'
- '#Cannot call method .* on Illuminate\\Testing\\PendingCommand\|int#'
- '#Cannot call method .* on mixed#'
Expand Down
21 changes: 10 additions & 11 deletions phpunit-coverage.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
backupStaticProperties="false"
bootstrap="vendor/autoload.php"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
cacheDirectory=".phpunit.cache"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<coverage includeUncoveredFiles="true">
<report>
<html outputDirectory="build/coverage/coverage-html"/>
<xml outputDirectory="build/coverage/coverage-xml"/>
Expand All @@ -29,4 +23,9 @@
<logging>
<junit outputFile="build/coverage/junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
11 changes: 4 additions & 7 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
backupStaticProperties="false"
bootstrap="vendor/autoload.php"
colors="true"
convertDeprecationsToExceptions="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
cacheDirectory=".phpunit.cache"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
Expand Down

0 comments on commit 6bfe611

Please sign in to comment.