@@ -745,6 +745,56 @@ plugins {
745745 ok ( ! detected . some ( ( t ) => t . id === "php" ) ) ;
746746 } ) ;
747747
748+ it ( "detects Laravel from artisan file" , ( ) => {
749+ writeFile ( tmp . path , "artisan" , "#!/usr/bin/env php\n<?php\ndefine('LARAVEL_START', microtime(true));" ) ;
750+ const { detected } = detectTechnologies ( tmp . path ) ;
751+ ok ( detected . some ( ( t ) => t . id === "laravel" ) ) ;
752+ } ) ;
753+
754+ it ( "detects Laravel from bootstrap/app.php" , ( ) => {
755+ writeFile ( tmp . path , "bootstrap/app.php" , "return $app;" ) ;
756+ const { detected } = detectTechnologies ( tmp . path ) ;
757+ ok ( detected . some ( ( t ) => t . id === "laravel" ) ) ;
758+ } ) ;
759+
760+ it ( "detects Laravel from composer.json with laravel/framework" , ( ) => {
761+ writeFile (
762+ tmp . path ,
763+ "composer.json" ,
764+ JSON . stringify ( { require : { "laravel/framework" : "^11.0" } } ) ,
765+ ) ;
766+ const { detected } = detectTechnologies ( tmp . path ) ;
767+ ok ( detected . some ( ( t ) => t . id === "laravel" ) ) ;
768+ } ) ;
769+
770+ it ( "detects Laravel from composer.json with illuminate packages" , ( ) => {
771+ writeFile (
772+ tmp . path ,
773+ "composer.json" ,
774+ JSON . stringify ( { require : { "illuminate/support" : "^11.0" } } ) ,
775+ ) ;
776+ const { detected } = detectTechnologies ( tmp . path ) ;
777+ ok ( detected . some ( ( t ) => t . id === "laravel" ) ) ;
778+ } ) ;
779+
780+ it ( "returns correct skills for Laravel detection" , ( ) => {
781+ writeFile (
782+ tmp . path ,
783+ "composer.json" ,
784+ JSON . stringify ( { require : { "laravel/framework" : "^11.0" } } ) ,
785+ ) ;
786+ const { detected } = detectTechnologies ( tmp . path ) ;
787+ const laravel = detected . find ( ( t ) => t . id === "laravel" ) ;
788+ ok ( laravel ) ;
789+ ok ( laravel . skills . includes ( "jpcaparas/superpowers-laravel" ) ) ;
790+ } ) ;
791+
792+ it ( "does not detect Laravel without Laravel files or packages" , ( ) => {
793+ writePackageJson ( tmp . path , { dependencies : { express : "^4.0.0" } } ) ;
794+ const { detected } = detectTechnologies ( tmp . path ) ;
795+ ok ( ! detected . some ( ( t ) => t . id === "laravel" ) ) ;
796+ } ) ;
797+
748798 it ( "detects Chrome Extension from manifest.json with manifest_version" , ( ) => {
749799 writeFile (
750800 tmp . path ,
0 commit comments