File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 runs-on : ubuntu-latest
1313
1414 steps :
15- - uses : actions/checkout@v2
15+ - uses : actions/checkout@v3
1616
1717 - name : Validate composer.json and composer.lock
1818 run : composer validate
3232
3333 - name : Run test suite
3434 env :
35- TEST_ACCESS_TOKEN : ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
35+ TEST_CONFIGURATION_ACCESS_TOKEN : ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
3636 run : composer run-script test
Original file line number Diff line number Diff line change 1+ name : PHP Versions
2+
3+ on :
4+ push :
5+ branches : [ master, main ]
6+ pull_request :
7+ branches : [ master, main ]
8+
9+ jobs :
10+ run :
11+ runs-on : ${{ matrix.operating-system }}
12+ strategy :
13+ matrix :
14+ operating-system : [ubuntu-latest, windows-latest, macOS-latest]
15+ php-versions : ['7.3', '8.0', '8.1']
16+ name : PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v3
20+ - name : Install PHP
21+ uses : shivammathur/setup-php@v2
22+ with :
23+ php-version : ${{ matrix.php-versions }}
24+ - name : Install dependencies
25+ run : composer install --prefer-dist --no-progress --no-suggest
26+
27+ - name : Run test suite
28+ env :
29+ TEST_CONFIGURATION_ACCESS_TOKEN : ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
30+ run : composer run-script test
Original file line number Diff line number Diff line change 3838$ config = new Configuration ();
3939$ config ->setClientId ('ClientId from https://dashboard.aspose.cloud/applications ' );
4040$ config ->setClientSecret ('Client Secret from https://dashboard.aspose.cloud/applications ' );
41- if (getenv ("TEST_ACCESS_TOKEN " )) {
42- $ config ->setAccessToken (getenv ("TEST_ACCESS_TOKEN " ));
41+ if (getenv ("TEST_CONFIGURATION_ACCESS_TOKEN " )) {
42+ $ config ->setAccessToken (getenv ("TEST_CONFIGURATION_ACCESS_TOKEN " ));
4343}
4444
4545$ request = new GetBarcodeGenerateRequest (EncodeBarcodeType::QR , 'PHP SDK Test ' );
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ public function testConfigurationJsonEncode(): void
2222 $ config ->setAccessToken ('access token ' );
2323
2424 $ json = json_encode ($ config , JSON_PRETTY_PRINT );
25+ // Fix line endings on Windows
26+ $ json = preg_replace ("/(?<=[^ \r]|^) \n/ " , PHP_EOL , $ json );
2527
2628 $ this ->assertEquals (
2729 '{
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ public static function fromEnv(string $prefix): Configuration
6060 return $ config ;
6161 }
6262
63- public static function fromFileOrEnv (string $ filename = 'Configuration.json ' , string $ prefix = 'TEST_ ' ): Configuration
63+ public static function fromFileOrEnv (string $ filename = 'Configuration.json ' , string $ prefix = 'TEST_CONFIGURATION_ ' ): Configuration
6464 {
6565 $ contents = false ;
6666 try {
You can’t perform that action at this time.
0 commit comments