Category: Lighthouse
-
Post Views: 15 1. When writing the automated test cases of Lighthouse 5, phpstorm cannot be completed automatically. When you click $response->assetJSON, you cannot find the statement you want to go to. fashionAssertJSONNot found in \illuminate\testing\testResponse. as shown in Figure 1 2. Print the $response object, its actual path is:\illuminate\foundation\testing\testResponse. as shown in Figure 2 3. In another project, phpstorm…
-
Post Views: 18 1. When writing the automated test cases of Lighthouse 5, phpstorm cannot be completed automatically. When you click $response->assetJSON, you cannot find the statement you want to go to. fashionAssertJSONNot found in \illuminate\testing\testResponse. as shown in Figure 1 2. Print the $response object, its actual path is:\illuminate\foundation\testing\testResponse. as shown in Figure 2 3. In another project, phpstorm…
-
Post Views: 19 1. When writing the automated test case of Lighthouse 5, split a test method into two test methods. The present stage is a method 2, split into two methods 3. Run the test and report an error: Error: Error: call to undefined method illuminate\support\facades\config::set(). as shown in Figure 1 4. At this time, if any of the…
-
Post Views: 16 1. When running the test case of lighthouse, an error is reported: classoverTrue\LaravelVersionABLE\ServiceProvidernot found. as shown in Figure 1 2. Search the class in the IDE: overtrue\LaravelVelVersionable\ServiceProvider, not found. as shown in Figure 2 3. Find the code in the project: LaravelVersionable, find the file /bootstrap/cache/packages.phpunit.php exists in: overtrue\\LaravelVersionable\\ServiceProvider . as shown in Figure 3 4. View…
-
Post Views: 16 1. Reference URL:https://lighthouse-php.com/4/testing/phpunit.html#setup, test with phpunit . In Lighthouse, it is easy to add automated tests with phpunit. 2. Run the GraphQL Query API and respond 200. The main test field: The responses of TheMeAssets. as shown in Figure 1 3. Edit /modules/themestore/tests/functional/graphql/onlineStoreEthemeGraphQLapTest.php, the code is as follows 4. Execute the command: ./vendor/bin/phpunit .\modules\themestore\tests\functional\graphql\OnlineStoreEthemeGraphQLapTest.php . Error: Failed…
-
Post Views: 15 1. The name of the table field is in the form of lowercase letters and underscores. as shown in Figure 1 2. The interface is implemented based on GraphQL, and the field name that is specified as the interface response must be in the form of hump. 3. Print the parser /modules/themestore/resolver/onlinestoreetheme/themeassesResolver.php method $themeAssets, the object property…
-
Post Views: 13 1. In Lighthouse 4.10.1, add a new Query Type: There is no effect after obtaining the theme material list. 2. Check the document, there is no existence to get the list of theme materials. as shown in Figure 1 3. Refer to schema caching:https://lighthouse-php.com/4/performance/schema-caching.html, it is recommended to enable cache in production mode. Now for the local…
-
Post Views: 16 1. Get started with the GraphQL server with Lighthouse. Reference URL:https://lighthouse-php.cn/tutorial/ 2. Create a GraphQL API for a simple blog from scratch. Create a new Laravel project via Composer: lighthouse-tutorial 3. Create a database: lighthouse_tutorial, and configure the database connection in .env. Run the database migration to create the Users table 4. Put some fake user data…