@@ -23,10 +23,10 @@ import (
2323 "testing"
2424)
2525
26- func TestVersion_IsVariant (t * testing.T ) {
26+ func TestVersion_SupportsFlavor (t * testing.T ) {
2727 testCases := []struct {
28- version * Version
29- expectedVariants []string
28+ version * Version
29+ expectedFlavors []string
3030 }{
3131 {
3232 version : func () * Version {
@@ -35,7 +35,7 @@ func TestVersion_IsVariant(t *testing.T) {
3535 v .PHPPath = "/usr/bin/php-8.1"
3636 return v
3737 }(),
38- expectedVariants : []string {"fpm" , "cli" },
38+ expectedFlavors : []string {"fpm" , "cli" },
3939 },
4040 {
4141 version : func () * Version {
@@ -44,15 +44,15 @@ func TestVersion_IsVariant(t *testing.T) {
4444 v .PHPPath = "/usr/bin/php-8.1"
4545 return v
4646 }(),
47- expectedVariants : []string {"cgi" , "cli" },
47+ expectedFlavors : []string {"cgi" , "cli" },
4848 },
4949 {
5050 version : func () * Version {
5151 v := NewVersion ("8.3" )
5252 v .PHPPath = "/usr/bin/php-8.3"
5353 return v
5454 }(),
55- expectedVariants : []string {"cli" },
55+ expectedFlavors : []string {"cli" },
5656 },
5757 {
5858 version : func () * Version {
@@ -61,7 +61,7 @@ func TestVersion_IsVariant(t *testing.T) {
6161 v .FrankenPHP = true
6262 return v
6363 }(),
64- expectedVariants : []string {"frankenphp" },
64+ expectedFlavors : []string {"frankenphp" },
6565 },
6666 {
6767 version : func () * Version {
@@ -70,28 +70,28 @@ func TestVersion_IsVariant(t *testing.T) {
7070 v .FPMPath = "/usr/bin/php-fpm"
7171 return v
7272 }(),
73- expectedVariants : []string {"fpm" , "cli" },
73+ expectedFlavors : []string {"fpm" , "cli" },
7474 },
7575 }
7676 for _ , testCase := range testCases {
77- if ! testCase .version .SupportsVariant ("" ) {
78- t .Error ("version.SupportsVariant ('') should return true, got false" )
77+ if ! testCase .version .SupportsFlavor ("" ) {
78+ t .Error ("version.SupportsFlavor ('') should return true, got false" )
7979 }
80- for _ , variant := range testCase .expectedVariants {
81- if ! testCase .version .SupportsVariant ( variant ) {
82- t .Errorf ("version.SupportsVariant (%v) should return true, got false" , variant )
80+ for _ , flavor := range testCase .expectedFlavors {
81+ if ! testCase .version .SupportsFlavor ( flavor ) {
82+ t .Errorf ("version.SupportsFlavor (%v) should return true, got false" , flavor )
8383 }
8484 }
85- variantsLoop :
86- for _ , possibleVariant := range []string {"cli" , "cgi" , "fpm" , "frankenphp" , "franken" } {
87- for _ , variant := range testCase .expectedVariants {
88- if variant == possibleVariant {
89- continue variantsLoop
85+ flavorLoop :
86+ for _ , possibleFlavor := range []string {"cli" , "cgi" , "fpm" , "frankenphp" , "franken" } {
87+ for _ , flavor := range testCase .expectedFlavors {
88+ if flavor == possibleFlavor {
89+ continue flavorLoop
9090 }
9191 }
9292
93- if testCase .version .SupportsVariant ( possibleVariant ) {
94- t .Errorf ("version.SupportsVariant (%v) should return false, got true" , possibleVariant )
93+ if testCase .version .SupportsFlavor ( possibleFlavor ) {
94+ t .Errorf ("version.SupportsFlavor (%v) should return false, got true" , possibleFlavor )
9595 }
9696 }
9797 }
0 commit comments