mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-09-20 10:51:29 +00:00
Support all valid PHP version file values (#1121)
* Support all valid PHP version file values Allow version files to use partial versions and aliases accepted by the php-version input while preserving support for both plain .php-version files and asdf-style php entries. * Regenerate bundled action --------- Co-authored-by: Shivam Mathur <shivam_jpr@hotmail.com>
This commit is contained in:
co-authored by
Shivam Mathur
parent
e3f88f3ca7
commit
0bbee91078
@@ -334,6 +334,12 @@ describe('Utils tests', () => {
|
||||
readFileSync.mockReturnValue('ruby 1.2.3\nphp 8.4.2\nnode 20.1.2');
|
||||
expect(await utils.readPHPVersion()).toBe('8.4.2');
|
||||
|
||||
readFileSync.mockReturnValue('ruby 1.2.3\nphp 8.4\nnode 20.1.2');
|
||||
expect(await utils.readPHPVersion()).toBe('8.4');
|
||||
|
||||
readFileSync.mockReturnValue('ruby 1.2.3\nphp latest\nnode 20.1.2');
|
||||
expect(await utils.readPHPVersion()).toBe('latest');
|
||||
|
||||
existsSync.mockReturnValue(true);
|
||||
readFileSync.mockReturnValue('setup-php');
|
||||
await expect(utils.readPHPVersion()).rejects.toThrow('Invalid PHP version');
|
||||
|
||||
Reference in New Issue
Block a user