github.com/anchore/syft@v1.4.2-0.20240516191711-1bec1fc5d397/syft/pkg/cataloger/wordpress/cataloger_test.go (about) 1 package wordpress 2 3 import ( 4 "testing" 5 6 "github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest" 7 ) 8 9 func Test_WordpressPlugin_Globs(t *testing.T) { 10 tests := []struct { 11 name string 12 fixture string 13 expected []string 14 }{ 15 { 16 name: "obtain wordpress plugin files", 17 fixture: "test-fixtures/glob-paths", 18 expected: []string{ 19 "wp-content/plugins/akismet/akismet.php", 20 "wp-content/plugins/all-in-one-wp-migration/all-in-one-wp-migration.php", 21 }, 22 }, 23 } 24 25 for _, test := range tests { 26 t.Run(test.name, func(t *testing.T) { 27 pkgtest.NewCatalogTester(). 28 FromDirectory(t, test.fixture). 29 ExpectsResolverContentQueries(test.expected). 30 TestCataloger(t, NewWordpressPluginCataloger()) 31 }) 32 } 33 }