This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Coveralls | |
| Write-Host "Generating Coveralls code coverage report..." | |
| $files = Get-ChildItem * -Include *.ps1,*.psm1 | |
| $token = 'ObxiFdeVVwlsneHqQqf5sAjdWIWiCi32X' | |
| $coverage = Format-Coverage -PesterResults $res -CoverallsApiToken $token | |
| Publish-Coverage -Coverage $coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Pester | |
| Write-Host "Running Pester unit tests..." | |
| $testResultsFile = ".\TestsResults.xml" | |
| $res = Invoke-Pester -Path ".\Tests" -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru -CodeCoverage *.psm1 | |
| (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestsResults.xml)) | |
| If ($res.FailedCount -gt 0) { | |
| Throw "Build failed due to $($res.FailedCount) failing tests" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PSscriptAnalyzer | |
| Write-Host 'Running PSScriptAnalyser coding standards analysis...' | |
| Add-AppveyorTest -Name "PsScriptAnalyzer" -Outcome Running | |
| $res = Invoke-ScriptAnalyzer -Path $pwd -Recurse -ErrorAction SilentlyContinue | |
| If ($res) { | |
| $resultString = $res | Out-String | |
| Write-Warning $resultString | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # type constraints | |
| [string]$myString = "Some String" | |
| [array]=@( | |
| "item1" | |
| "item2" | |
| ) | |
| [hashtable]$myHashTable = @{ | |
| "key" = "value" | |
| "sub-array" = @( | |
| "item1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # type constraints | |
| [string]$myString = "Some String" | |
| [array]=@( | |
| "item1" | |
| "item2" | |
| ) | |
| [hashtable]$myHashTable = @{ | |
| "key" = "value" | |
| "sub-array" = @( | |
| "item1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /etc/nginx/sites-available/cake3.app | |
| # | |
| # Cakebox-generated Nginx PHP-FMP virtual host using generic template. | |
| # | |
| server { | |
| listen 80; | |
| server_name www.cake3.app; | |
| rewrite ^(.*) http://cake3.app$1 permanent; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package pg; | |
| public class MyUtils { | |
| public void testMe() { | |
| System.out.println("most simple class"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pre class="pr">Cake\Http\Response Object | |
| ( | |
| [status] => 200 | |
| [contentType] => text/html | |
| [headers] => Array | |
| ( | |
| [Content-Type] => Array | |
| ( | |
| [0] => text/html; charset=UTF-8 | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pre class="pr">after</pre> | |
| <pre class="pr">App\Controller\ErrorController Object | |
| ( | |
| [name] => Cocktails | |
| [helpers] => Array | |
| ( | |
| ) | |
| [request] => Cake\Http\ServerRequest Object | |
| ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function validationDefault(Validator $validator) | |
| { | |
| // make sure `approved` is a boolean | |
| $validator | |
| ->add('approved', 'BOOLEAN', [ | |
| 'rule' => 'boolean', | |
| 'message' => 'Approved must be a boolean.' | |
| ]); | |
| return $validator; |