From 5c7a7cb4ae7e2788fcb9a26f8c250336c11923d2 Mon Sep 17 00:00:00 2001 From: rivanuff Date: Fri, 20 Feb 2026 16:43:21 +0100 Subject: [PATCH 1/5] feat: show release info in git branch sub menu --- .gitignore | 1 + src/BranchViewer/BranchViewer.php | 65 ++++++++++++++++++- .../BranchViewerServiceProvider.php | 14 +++- .../BranchViewerServiceProviderTest.php | 5 ++ tests/BranchViewer/BranchViewerTest.php | 50 +++++++++++++- 5 files changed, 129 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 49bedc5..514ed00 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ vendor node_modules build tests/BranchViewer/test_git/HEAD +tests/BranchViewer/test_dep/releases_log diff --git a/src/BranchViewer/BranchViewer.php b/src/BranchViewer/BranchViewer.php index bf487b2..facac6e 100644 --- a/src/BranchViewer/BranchViewer.php +++ b/src/BranchViewer/BranchViewer.php @@ -4,18 +4,25 @@ namespace Yard\ConfigExpander\BranchViewer; +use DateTime; +use DateTimeZone; use DomainException; use LogicException; +use RuntimeException; class BranchViewer { protected string $branchname; + protected string $releaseInfo; private string $gitPath; + private string $releasePath; - public function __construct(string $gitPath) + public function __construct(string $gitPath, string $releasePath) { $this->gitPath = $gitPath; + $this->releasePath = $releasePath; $this->branchname = $this->constructBranchname(); + $this->releaseInfo = $this->constructReleaseInfo(); } public function getBranchname(): string @@ -23,6 +30,11 @@ public function getBranchname(): string return trim($this->branchname); } + public function getReleaseInfo(): string + { + return trim($this->releaseInfo); + } + protected function constructBranchname(): string { $branches = file($this->getGitDirectory(), FILE_USE_INCLUDE_PATH); // output: 'ref: refs/heads/feature/branchname' @@ -33,6 +45,17 @@ protected function constructBranchname(): string return $this->extractBranchname($branches); } + protected function constructReleaseInfo(): string + { + $releases = file($this->getReleaseLog(), FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + + if (false === $releases) { + $releases = []; + } + + return $this->extractReleaseInfo($releases); + } + protected function getGitDirectory(): string { if (! file_exists($this->gitPath)) { @@ -42,6 +65,15 @@ protected function getGitDirectory(): string return $this->gitPath; } + protected function getReleaseLog(): string + { + if (! file_exists($this->releasePath)) { + throw new DomainException('Release log does not exist'); + } + + return $this->releasePath; + } + /** * Extracts the branchname from the array - input: 'ref: refs/heads/feature/branchname' * 1) Converts the array to a string @@ -77,4 +109,35 @@ private function handlePossibleCommit(string $branch): string // Return the first 7 characters of the commit hash. return sprintf('%s (commit)', substr($branch, 0, 7)); } + + private function extractReleaseInfo(array $releases): string { + $release = end($releases); + + if (empty($release)) { + throw new LogicException('No release found'); + } + + $data = json_decode($release, true); + + if (json_last_error() !== JSON_ERROR_NONE) { + throw new RuntimeException('Invalid release JSON'); + } + + $timezone = 'Europe/Amsterdam'; + + if (function_exists('get_option')) { + $timezone = get_option('timezone_string', 'Europe/Amsterdam'); + } + + $date = new DateTime($data['created_at']); + $date->setTimezone(new DateTimeZone($timezone)); + $formattedDate = $date->format('d-m-Y - H:i:s'); + + return sprintf( + 'Release #%s deployed on %s by %s', + $data['release_name'], + $formattedDate, + $data['user'] + ); + } } diff --git a/src/BranchViewer/BranchViewerServiceProvider.php b/src/BranchViewer/BranchViewerServiceProvider.php index 61f495e..f67ba87 100644 --- a/src/BranchViewer/BranchViewerServiceProvider.php +++ b/src/BranchViewer/BranchViewerServiceProvider.php @@ -7,6 +7,7 @@ use DomainException; use Illuminate\Support\ServiceProvider; use LogicException; +use RuntimeException; use WP_Admin_Bar; class BranchViewerServiceProvider extends ServiceProvider @@ -28,9 +29,10 @@ public function addBranchViewer(WP_Admin_Bar $adminBar): void } try { - $branch = new BranchViewer(\ABSPATH.'../../.git/HEAD'); + $branch = new BranchViewer(\ABSPATH.'../../.git/HEAD', \ABSPATH.'../../../../.dep/releases_log'); $title = sprintf('Branch: %s', $branch->getBranchname()); - } catch (DomainException | LogicException $e) { + $releaseInfo = $branch->getReleaseInfo(); + } catch (DomainException | LogicException | RuntimeException $e) { $title = $e->getMessage(); } @@ -38,5 +40,13 @@ public function addBranchViewer(WP_Admin_Bar $adminBar): void 'id' => 'yard-git-branch', 'title' => $title, ]); + + if ($releaseInfo) { + $adminBar->add_menu([ + 'id' => 'yard-release-info', + 'parent' => 'yard-git-branch', + 'title' => $releaseInfo, + ]); + } } } diff --git a/tests/BranchViewer/BranchViewerServiceProviderTest.php b/tests/BranchViewer/BranchViewerServiceProviderTest.php index 8f8cb7d..9d43a9e 100644 --- a/tests/BranchViewer/BranchViewerServiceProviderTest.php +++ b/tests/BranchViewer/BranchViewerServiceProviderTest.php @@ -11,10 +11,15 @@ beforeEach(function () { $this->app->instance('path.public', __DIR__); $this->validGitPath = __DIR__ . '/test_git/HEAD'; + $this->validReleasePath = __DIR__ . '/test_dep/release_log'; if (! file_exists(dirname($this->validGitPath))) { mkdir(dirname($this->validGitPath), 0777, true); } + + if (! file_exists(dirname($this->validReleasePath))) { + mkdir(dirname($this->validReleasePath), 0777, true); + } }); /** diff --git a/tests/BranchViewer/BranchViewerTest.php b/tests/BranchViewer/BranchViewerTest.php index 6adb9d1..49431ed 100644 --- a/tests/BranchViewer/BranchViewerTest.php +++ b/tests/BranchViewer/BranchViewerTest.php @@ -6,11 +6,14 @@ use DomainException; use LogicException; +use RuntimeException; use Yard\ConfigExpander\BranchViewer\BranchViewer; beforeEach(function () { $this->validGitPath = __DIR__ . '/test_git/HEAD'; + $this->validReleasePath = __DIR__ . '/test_dep/releases_log'; $this->invalidGitPath = __DIR__ . '/invalid_git/HEAD'; + $this->invalidReleasePath = __DIR__ . '/invalid_dep/releases_log'; if (! file_exists(dirname($this->validGitPath))) { mkdir(dirname($this->validGitPath), 0777, true); @@ -23,7 +26,7 @@ * @preserveGlobalState disabled */ test('constructBranchname throws DomainException if git directory does not exist', function () { - expect(fn () => new BranchViewer($this->invalidGitPath)) + expect(fn () => new BranchViewer($this->invalidGitPath, $this->invalidReleasePath)) ->toThrow(DomainException::class, 'Git directory does not exist'); }); @@ -34,8 +37,9 @@ */ test('constructBranchname throws LogicException if no branch name is found', function () { file_put_contents($this->validGitPath, ''); + file_put_contents($this->validReleasePath, '{"created_at":"2026-02-20T15:54:49+0000","release_name":"466","user":"rivanuff","target":"chore\/deployment-info"}'); - expect(fn () => new BranchViewer($this->validGitPath)) + expect(fn () => new BranchViewer($this->validGitPath, $this->validReleasePath)) ->toThrow(LogicException::class, 'No branchname found'); }); @@ -46,7 +50,47 @@ */ test('getBranchname returns the branch name', function () { file_put_contents($this->validGitPath, 'ref: refs/heads/feature/branchname'); + file_put_contents($this->validReleasePath, '{"created_at":"2026-02-20T15:54:49+0000","release_name":"466","user":"rivanuff","target":"chore\/deployment-info"}'); - $branchViewer = new BranchViewer($this->validGitPath); + $branchViewer = new BranchViewer($this->validGitPath, $this->validReleasePath); expect($branchViewer->getBranchname())->toBe('feature/branchname'); }); + +/** + * @runInSeparateProcess + * + * @preserveGlobalState disabled + */ +test('constructReleaseInfo throws LogicException if no release is found', function () { + file_put_contents($this->validGitPath, 'ref: refs/heads/feature/branchname'); + file_put_contents($this->validReleasePath, ''); + + expect(fn () => new BranchViewer($this->validGitPath, $this->validReleasePath)) + ->toThrow(LogicException::class, 'No release found'); +}); + +/** + * @runInSeparateProcess + * + * @preserveGlobalState disabled + */ +test('getReleaseInfo returns RuntimeException when release JSON invalid', function () { + file_put_contents($this->validGitPath, 'ref: refs/heads/feature/branchname'); + file_put_contents($this->validReleasePath, '{"created_at"|"2026-02-20T15:54:49+0000""release_name":"466","user":"rivanuff","target":"chore\/deployment-info"}'); + + expect(fn () => new BranchViewer($this->validGitPath, $this->validReleasePath)) + ->toThrow(RuntimeException::class, 'Invalid release JSON'); +}); + +/** + * @runInSeparateProcess + * + * @preserveGlobalState disabled + */ +test('getReleaseInfo returns the release info', function () { + file_put_contents($this->validGitPath, 'ref: refs/heads/feature/branchname'); + file_put_contents($this->validReleasePath, '{"created_at":"2026-02-20T15:54:49+0000","release_name":"466","user":"rivanuff","target":"chore\/deployment-info"}'); + + $branchViewer = new BranchViewer($this->validGitPath, $this->validReleasePath); + expect($branchViewer->getReleaseInfo())->toBe('Release #466 deployed on 20-02-2026 - 16:54:49 by rivanuff'); +}); From bf3adee5721cc1d9cc401839acaea294b99a2e9a Mon Sep 17 00:00:00 2001 From: Yard workflows Date: Fri, 20 Feb 2026 16:27:53 +0000 Subject: [PATCH 2/5] style: apply php-cs-fixer changes --- src/BranchViewer/BranchViewer.php | 43 ++++++++++--------- .../BranchViewerServiceProvider.php | 14 +++--- tests/BranchViewer/BranchViewerTest.php | 2 +- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/BranchViewer/BranchViewer.php b/src/BranchViewer/BranchViewer.php index facac6e..283ea67 100644 --- a/src/BranchViewer/BranchViewer.php +++ b/src/BranchViewer/BranchViewer.php @@ -45,7 +45,7 @@ protected function constructBranchname(): string return $this->extractBranchname($branches); } - protected function constructReleaseInfo(): string + protected function constructReleaseInfo(): string { $releases = file($this->getReleaseLog(), FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); @@ -110,34 +110,35 @@ private function handlePossibleCommit(string $branch): string return sprintf('%s (commit)', substr($branch, 0, 7)); } - private function extractReleaseInfo(array $releases): string { - $release = end($releases); + private function extractReleaseInfo(array $releases): string + { + $release = end($releases); if (empty($release)) { throw new LogicException('No release found'); } - $data = json_decode($release, true); + $data = json_decode($release, true); - if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException('Invalid release JSON'); - } + if (json_last_error() !== JSON_ERROR_NONE) { + throw new RuntimeException('Invalid release JSON'); + } - $timezone = 'Europe/Amsterdam'; + $timezone = 'Europe/Amsterdam'; - if (function_exists('get_option')) { - $timezone = get_option('timezone_string', 'Europe/Amsterdam'); - } + if (function_exists('get_option')) { + $timezone = get_option('timezone_string', 'Europe/Amsterdam'); + } - $date = new DateTime($data['created_at']); - $date->setTimezone(new DateTimeZone($timezone)); - $formattedDate = $date->format('d-m-Y - H:i:s'); + $date = new DateTime($data['created_at']); + $date->setTimezone(new DateTimeZone($timezone)); + $formattedDate = $date->format('d-m-Y - H:i:s'); - return sprintf( - 'Release #%s deployed on %s by %s', - $data['release_name'], - $formattedDate, - $data['user'] - ); - } + return sprintf( + 'Release #%s deployed on %s by %s', + $data['release_name'], + $formattedDate, + $data['user'] + ); + } } diff --git a/src/BranchViewer/BranchViewerServiceProvider.php b/src/BranchViewer/BranchViewerServiceProvider.php index f67ba87..d7ad861 100644 --- a/src/BranchViewer/BranchViewerServiceProvider.php +++ b/src/BranchViewer/BranchViewerServiceProvider.php @@ -41,12 +41,12 @@ public function addBranchViewer(WP_Admin_Bar $adminBar): void 'title' => $title, ]); - if ($releaseInfo) { - $adminBar->add_menu([ - 'id' => 'yard-release-info', - 'parent' => 'yard-git-branch', - 'title' => $releaseInfo, - ]); - } + if ($releaseInfo) { + $adminBar->add_menu([ + 'id' => 'yard-release-info', + 'parent' => 'yard-git-branch', + 'title' => $releaseInfo, + ]); + } } } diff --git a/tests/BranchViewer/BranchViewerTest.php b/tests/BranchViewer/BranchViewerTest.php index 49431ed..dc51000 100644 --- a/tests/BranchViewer/BranchViewerTest.php +++ b/tests/BranchViewer/BranchViewerTest.php @@ -78,7 +78,7 @@ file_put_contents($this->validGitPath, 'ref: refs/heads/feature/branchname'); file_put_contents($this->validReleasePath, '{"created_at"|"2026-02-20T15:54:49+0000""release_name":"466","user":"rivanuff","target":"chore\/deployment-info"}'); - expect(fn () => new BranchViewer($this->validGitPath, $this->validReleasePath)) + expect(fn () => new BranchViewer($this->validGitPath, $this->validReleasePath)) ->toThrow(RuntimeException::class, 'Invalid release JSON'); }); From 17b914a6bb310eb6dd9c069b1579575298d0564d Mon Sep 17 00:00:00 2001 From: rivanuff Date: Tue, 24 Feb 2026 09:37:35 +0100 Subject: [PATCH 3/5] chore: feedback --- src/BranchViewer/BranchViewer.php | 25 ++++++++++++------------- tests/BranchViewer/BranchViewerTest.php | 14 +++++++------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/BranchViewer/BranchViewer.php b/src/BranchViewer/BranchViewer.php index 283ea67..9664409 100644 --- a/src/BranchViewer/BranchViewer.php +++ b/src/BranchViewer/BranchViewer.php @@ -7,13 +7,13 @@ use DateTime; use DateTimeZone; use DomainException; +use InvalidArgumentException; use LogicException; -use RuntimeException; class BranchViewer { protected string $branchname; - protected string $releaseInfo; + protected ?string $releaseInfo; private string $gitPath; private string $releasePath; @@ -30,9 +30,9 @@ public function getBranchname(): string return trim($this->branchname); } - public function getReleaseInfo(): string + public function getReleaseInfo(): ?string { - return trim($this->releaseInfo); + return $this->releaseInfo; } protected function constructBranchname(): string @@ -45,7 +45,7 @@ protected function constructBranchname(): string return $this->extractBranchname($branches); } - protected function constructReleaseInfo(): string + protected function constructReleaseInfo(): ?string { $releases = file($this->getReleaseLog(), FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); @@ -110,18 +110,18 @@ private function handlePossibleCommit(string $branch): string return sprintf('%s (commit)', substr($branch, 0, 7)); } - private function extractReleaseInfo(array $releases): string + private function extractReleaseInfo(array $releases): ?string { $release = end($releases); - if (empty($release)) { - throw new LogicException('No release found'); + if (! is_string($release) || '' === trim($release)) { + return null; } $data = json_decode($release, true); - if (json_last_error() !== JSON_ERROR_NONE) { - throw new RuntimeException('Invalid release JSON'); + if (json_last_error() !== JSON_ERROR_NONE || ! is_string($data['created_at']) || ! is_string($data['user'])) { + throw new InvalidArgumentException('Invalid release JSON'); } $timezone = 'Europe/Amsterdam'; @@ -135,10 +135,9 @@ private function extractReleaseInfo(array $releases): string $formattedDate = $date->format('d-m-Y - H:i:s'); return sprintf( - 'Release #%s deployed on %s by %s', - $data['release_name'], + 'Deployed on %s by %s', $formattedDate, - $data['user'] + trim($data['user']) ); } } diff --git a/tests/BranchViewer/BranchViewerTest.php b/tests/BranchViewer/BranchViewerTest.php index dc51000..09bd906 100644 --- a/tests/BranchViewer/BranchViewerTest.php +++ b/tests/BranchViewer/BranchViewerTest.php @@ -5,8 +5,8 @@ namespace Yard\ConfigExpander\Tests\BranchViewer; use DomainException; +use InvalidArgumentException; use LogicException; -use RuntimeException; use Yard\ConfigExpander\BranchViewer\BranchViewer; beforeEach(function () { @@ -61,12 +61,12 @@ * * @preserveGlobalState disabled */ -test('constructReleaseInfo throws LogicException if no release is found', function () { +test('constructReleaseInfo to be null if no release is found', function () { file_put_contents($this->validGitPath, 'ref: refs/heads/feature/branchname'); file_put_contents($this->validReleasePath, ''); - expect(fn () => new BranchViewer($this->validGitPath, $this->validReleasePath)) - ->toThrow(LogicException::class, 'No release found'); + $branchViewer = new BranchViewer($this->validGitPath, $this->validReleasePath); + expect($branchViewer->getReleaseInfo())->toBe(null); }); /** @@ -74,12 +74,12 @@ * * @preserveGlobalState disabled */ -test('getReleaseInfo returns RuntimeException when release JSON invalid', function () { +test('getReleaseInfo returns InvalidArgumentException when release JSON invalid', function () { file_put_contents($this->validGitPath, 'ref: refs/heads/feature/branchname'); file_put_contents($this->validReleasePath, '{"created_at"|"2026-02-20T15:54:49+0000""release_name":"466","user":"rivanuff","target":"chore\/deployment-info"}'); expect(fn () => new BranchViewer($this->validGitPath, $this->validReleasePath)) - ->toThrow(RuntimeException::class, 'Invalid release JSON'); + ->toThrow(InvalidArgumentException::class, 'Invalid release JSON'); }); /** @@ -92,5 +92,5 @@ file_put_contents($this->validReleasePath, '{"created_at":"2026-02-20T15:54:49+0000","release_name":"466","user":"rivanuff","target":"chore\/deployment-info"}'); $branchViewer = new BranchViewer($this->validGitPath, $this->validReleasePath); - expect($branchViewer->getReleaseInfo())->toBe('Release #466 deployed on 20-02-2026 - 16:54:49 by rivanuff'); + expect($branchViewer->getReleaseInfo())->toBe('Deployed on 20-02-2026 - 16:54:49 by rivanuff'); }); From 644d451358df0f0ee9f0995bb4697cf198215c8a Mon Sep 17 00:00:00 2001 From: rivanuff Date: Tue, 24 Feb 2026 10:09:42 +0100 Subject: [PATCH 4/5] chore: phpstan --- src/BranchViewer/BranchViewer.php | 11 +++++++++-- src/BranchViewer/BranchViewerServiceProvider.php | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/BranchViewer/BranchViewer.php b/src/BranchViewer/BranchViewer.php index 9664409..5caa50e 100644 --- a/src/BranchViewer/BranchViewer.php +++ b/src/BranchViewer/BranchViewer.php @@ -110,6 +110,9 @@ private function handlePossibleCommit(string $branch): string return sprintf('%s (commit)', substr($branch, 0, 7)); } + /** + * @param array $releases + */ private function extractReleaseInfo(array $releases): ?string { $release = end($releases); @@ -120,14 +123,18 @@ private function extractReleaseInfo(array $releases): ?string $data = json_decode($release, true); - if (json_last_error() !== JSON_ERROR_NONE || ! is_string($data['created_at']) || ! is_string($data['user'])) { + if (json_last_error() !== JSON_ERROR_NONE || ! is_array($data) || ! is_string($data['created_at']) || ! is_string($data['user'])) { throw new InvalidArgumentException('Invalid release JSON'); } $timezone = 'Europe/Amsterdam'; if (function_exists('get_option')) { - $timezone = get_option('timezone_string', 'Europe/Amsterdam'); + $timezoneOption = get_option('timezone_string', 'Europe/Amsterdam'); + + if (is_string($timezoneOption)) { + $timezone = $timezoneOption; + } } $date = new DateTime($data['created_at']); diff --git a/src/BranchViewer/BranchViewerServiceProvider.php b/src/BranchViewer/BranchViewerServiceProvider.php index d7ad861..4ad5092 100644 --- a/src/BranchViewer/BranchViewerServiceProvider.php +++ b/src/BranchViewer/BranchViewerServiceProvider.php @@ -33,6 +33,7 @@ public function addBranchViewer(WP_Admin_Bar $adminBar): void $title = sprintf('Branch: %s', $branch->getBranchname()); $releaseInfo = $branch->getReleaseInfo(); } catch (DomainException | LogicException | RuntimeException $e) { + $releaseInfo = null; $title = $e->getMessage(); } From 7eb6e000f202a66def1cd6ae93d14c8c97721233 Mon Sep 17 00:00:00 2001 From: Yard workflows Date: Tue, 24 Feb 2026 09:10:11 +0000 Subject: [PATCH 5/5] style: apply php-cs-fixer changes --- src/BranchViewer/BranchViewer.php | 12 ++++++------ src/BranchViewer/BranchViewerServiceProvider.php | 2 +- .../BranchViewer/BranchViewerServiceProviderTest.php | 2 +- tests/BranchViewer/BranchViewerTest.php | 4 ++++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/BranchViewer/BranchViewer.php b/src/BranchViewer/BranchViewer.php index 5caa50e..4722d4c 100644 --- a/src/BranchViewer/BranchViewer.php +++ b/src/BranchViewer/BranchViewer.php @@ -110,9 +110,9 @@ private function handlePossibleCommit(string $branch): string return sprintf('%s (commit)', substr($branch, 0, 7)); } - /** - * @param array $releases - */ + /** + * @param array $releases + */ private function extractReleaseInfo(array $releases): ?string { $release = end($releases); @@ -132,9 +132,9 @@ private function extractReleaseInfo(array $releases): ?string if (function_exists('get_option')) { $timezoneOption = get_option('timezone_string', 'Europe/Amsterdam'); - if (is_string($timezoneOption)) { - $timezone = $timezoneOption; - } + if (is_string($timezoneOption)) { + $timezone = $timezoneOption; + } } $date = new DateTime($data['created_at']); diff --git a/src/BranchViewer/BranchViewerServiceProvider.php b/src/BranchViewer/BranchViewerServiceProvider.php index 4ad5092..01bb5f3 100644 --- a/src/BranchViewer/BranchViewerServiceProvider.php +++ b/src/BranchViewer/BranchViewerServiceProvider.php @@ -33,7 +33,7 @@ public function addBranchViewer(WP_Admin_Bar $adminBar): void $title = sprintf('Branch: %s', $branch->getBranchname()); $releaseInfo = $branch->getReleaseInfo(); } catch (DomainException | LogicException | RuntimeException $e) { - $releaseInfo = null; + $releaseInfo = null; $title = $e->getMessage(); } diff --git a/tests/BranchViewer/BranchViewerServiceProviderTest.php b/tests/BranchViewer/BranchViewerServiceProviderTest.php index 9d43a9e..09c47dd 100644 --- a/tests/BranchViewer/BranchViewerServiceProviderTest.php +++ b/tests/BranchViewer/BranchViewerServiceProviderTest.php @@ -11,7 +11,7 @@ beforeEach(function () { $this->app->instance('path.public', __DIR__); $this->validGitPath = __DIR__ . '/test_git/HEAD'; - $this->validReleasePath = __DIR__ . '/test_dep/release_log'; + $this->validReleasePath = __DIR__ . '/test_dep/releases_log'; if (! file_exists(dirname($this->validGitPath))) { mkdir(dirname($this->validGitPath), 0777, true); diff --git a/tests/BranchViewer/BranchViewerTest.php b/tests/BranchViewer/BranchViewerTest.php index 09bd906..69e2881 100644 --- a/tests/BranchViewer/BranchViewerTest.php +++ b/tests/BranchViewer/BranchViewerTest.php @@ -18,6 +18,10 @@ if (! file_exists(dirname($this->validGitPath))) { mkdir(dirname($this->validGitPath), 0777, true); } + + if (! file_exists(dirname($this->validReleasePath))) { + mkdir(dirname($this->validReleasePath), 0777, true); + } }); /**