mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-07-25 08:09:08 +07:00
Rename resolveVersion to readPHPversion
This commit is contained in:
@ -10,7 +10,7 @@ jest.mock('../src/install', () => ({
|
||||
.mockImplementation(async (os: string): Promise<string> => {
|
||||
const filename = os + (await utils.scriptExtension(os));
|
||||
const version: string = await utils.parseVersion(
|
||||
await utils.resolveVersion()
|
||||
await utils.readPHPVersion()
|
||||
);
|
||||
const ini_file: string = await utils.parseIniFile(
|
||||
await utils.getInput('ini-file', false)
|
||||
|
@ -263,11 +263,11 @@ describe('Utils tests', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('checking resolveVersion', async () => {
|
||||
expect(await utils.resolveVersion()).toBe('latest');
|
||||
it('checking readPHPVersion', async () => {
|
||||
expect(await utils.readPHPVersion()).toBe('latest');
|
||||
|
||||
process.env['php-version-file'] = '.phpenv-version';
|
||||
await expect(utils.resolveVersion()).rejects.toThrow(
|
||||
await expect(utils.readPHPVersion()).rejects.toThrow(
|
||||
"Could not find '.phpenv-version' file."
|
||||
);
|
||||
|
||||
@ -277,10 +277,10 @@ describe('Utils tests', () => {
|
||||
existsSync.mockReturnValue(true);
|
||||
readFileSync.mockReturnValue('8.1');
|
||||
|
||||
expect(await utils.resolveVersion()).toBe('8.1');
|
||||
expect(await utils.readPHPVersion()).toBe('8.1');
|
||||
|
||||
process.env['php-version'] = '8.2';
|
||||
expect(await utils.resolveVersion()).toBe('8.2');
|
||||
expect(await utils.readPHPVersion()).toBe('8.2');
|
||||
|
||||
existsSync.mockClear();
|
||||
readFileSync.mockClear();
|
||||
|
Reference in New Issue
Block a user