diff --git a/composer.json b/composer.json index e4b73b5..ef8fb5e 100644 --- a/composer.json +++ b/composer.json @@ -102,7 +102,6 @@ "ergebnis/license": "^2.4", "ergebnis/php-cs-fixer-config": "dev-main", "ergebnis/rector-rules": "^1.0", - "guanguans/ai-commit": "dev-main", "guanguans/monorepo-builder-worker": "^1.4", "hyperf/composer-plugin": "^1.0", "icanhazstring/composer-unused": "^0.8", @@ -148,7 +147,7 @@ "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": false, + "forward-command": true, "target-directory": "vendor-bin" }, "hooks": { diff --git a/tests/Support/HeplersTest.php b/tests/Support/HeplersTest.php index f063de7..d18716e 100644 --- a/tests/Support/HeplersTest.php +++ b/tests/Support/HeplersTest.php @@ -17,21 +17,32 @@ * @see https://github.com/guanguans/laravel-exception-notify */ -use Guanguans\LaravelExceptionNotify\CollectorManager; -use Guanguans\LaravelExceptionNotify\ExceptionNotifyManager; +use Guanguans\LaravelExceptionNotify\Exceptions\InvalidArgumentException; -it('can make object', function (): void { - expect(make(ExceptionNotifyManager::class))->toBeInstanceOf(ExceptionNotifyManager::class) - ->and(make(CollectorManager::class))->toBeInstanceOf(CollectorManager::class); -})->group(__DIR__, __FILE__); +it('will throw `InvalidArgumentException` when abstract is null', function (): void { + make(null); +})->group(__DIR__, __FILE__)->throws(InvalidArgumentException::class); + +it('will throw `InvalidArgumentException` when abstract is empty array', function (): void { + make([]); +})->group(__DIR__, __FILE__)->throws(InvalidArgumentException::class); it('can explode env', function (): void { - expect(env_explode('ENV_EXPLODE_STRING'))->toBeArray()->toBeTruthy() - ->and(env_explode('ENV_EXPLODE_EMPTY'))->toBe([]) - ->and(env_explode('ENV_EXPLODE_NOT_EXIST'))->toBeNull(); - // ->and(env_explode('ENV_EXPLODE_TRUE'))->toBeTrue() - // ->and(env_explode('ENV_EXPLODE_FALSE'))->toBeFalse() - // ->and(env_explode('ENV_EXPLODE_NULL'))->toBeNull() + expect([ + env_explode('ENV_EXPLODE_STRING'), + env_explode('ENV_EXPLODE_EMPTY'), + env_explode('ENV_EXPLODE_NOT_EXIST'), + // env_explode('ENV_EXPLODE_FALSE'), + // env_explode('ENV_EXPLODE_NULL'), + // env_explode('ENV_EXPLODE_TRUE'), + ])->sequence( + static fn (Pest\Expectation $expectation): Pest\Expectation => $expectation->toBeArray()->toBeTruthy(), + static fn (Pest\Expectation $expectation): Pest\Expectation => $expectation->toBeArray()->toBeFalsy(), + static fn (Pest\Expectation $expectation): Pest\Expectation => $expectation->toBeNull(), + // static fn (Pest\Expectation $expectation): Pest\Expectation => $expectation->toBeFalse(), + // static fn (Pest\Expectation $expectation): Pest\Expectation => $expectation->toBeNull(), + // static fn (Pest\Expectation $expectation): Pest\Expectation => $expectation->toBeTrue(), + ); })->group(__DIR__, __FILE__); it('can human bytes', function (): void { diff --git a/vendor-bin/ai-commit/composer.json b/vendor-bin/ai-commit/composer.json new file mode 100644 index 0000000..d50276c --- /dev/null +++ b/vendor-bin/ai-commit/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "guanguans/ai-commit": "dev-main" + } +}