Category: Programming Language
-
Post Views: 17 1. When using Redis with Laravel, there are two solutions, one is to install the phpredis php extension, and the other is to install the predis/predis package through composer. However, Predis has been abandoned by the original author of the package and may be removed from Laravel in future releases. It was finally decided to use the…
-
Post Views: 15 1. When executing the command: npm run build, prompt: npm err! missing script: “build”. as shown in Figure 1 2. Check the package.json file, you can confirm that the scripts does not contain the build script. as shown in Figure 2 3. According to the prompt: to see a list of scripts, run: npm run. To view…
-
Post Views: 14 1. The data in the table is as follows 2. When executing a where like query, use likelayouts\\%Attempts to query the data rows starting with Layouts\. The result is empty. as shown in Figure 1 3. When executing a where like query, use likelayouts\\\%Attempts to query the data rows starting with Layouts\. Only the corresponding results are…
-
Post Views: 18 1. The existing array structure is as follows, and its key name is the form of lowercase letters and underscores. 2. It is expected to adjust the name of the array key to the hump form. The traditional way is to generate a new key in the form of a hump based on the foreach traversal. This…
-
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. 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…