Good to use with unit/integration tests of Spark Java app.
Spark Java is pretty much dead
name: Deployment Metrics Reporter | |
on: | |
workflow_call: | |
inputs: | |
service_name: | |
required: true | |
type: string | |
description: 'Name of the service being deployed' | |
environment: |
Good to use with unit/integration tests of Spark Java app.
Spark Java is pretty much dead
<?php | |
class Bob_Validator_BooleanTest extends PHPUnit_Framework_TestCase | |
{ | |
public function setUp() { | |
$this->authorizerMock = $this->getMock(Authorizer::class); | |
$this->authorizerMock->expects($this->once()) | |
->method('authorize')->willReturn(true); | |
} | |
<?php | |
class AuthorizerFake implements Authorizer { | |
public $allowedUsers = [ | |
'test_user' => '123456', | |
'test_admin' => '123456' | |
]; | |
public authorize($username, $password) { | |
return array_key_exists($this->allowedUsers, $username) | |
&& $this->allowedUsers[$username] === $password; |
<?php | |
class AcceptingAuthorizerSpy implements Authorizer { | |
public $authorizeWasCalled = false; | |
public authorize($username, $password) { | |
$this->authorizeWasCalled = true; | |
return true; | |
} | |
} |
<?php | |
class AcceptingAuthorizerStub implements Authorizer { | |
public function authorize($username, $password) { | |
return true; | |
} | |
} |
<?php | |
class DummyAuthorizer implements Authorizer { | |
public function authorize($username, $password) { | |
return null; | |
} | |
} |