Skip to content

Commit

Permalink
Coding standard fixes for the tests (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsolesen committed Mar 20, 2017
1 parent 43a5abf commit 381bc0c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
7 changes: 7 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!--suppress XmlUnboundNsPrefix -->
<ruleset name="EDBBrugs Coding standards">
<description>Coding standards is based on the PSR-2 coding standard.</description>
<rule ref="PSR2"/>
<file>./src</file>
</ruleset>
8 changes: 4 additions & 4 deletions tests/EDBBrugsSendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EDBBrugsSendTest extends \PHPUnit_Framework_TestCase
protected $brugs;
protected $registrations;

function setUp()
public function setUp()
{
$this->brugs = new Registration('brugernavn', 'adgangskode', '999999');
$this->registrations = array(
Expand Down Expand Up @@ -95,7 +95,7 @@ function setUp()
}
}

function testSoapAddNewRegistrationInteractingWithMockedOutWebservice()
public function testSoapAddNewRegistrationInteractingWithMockedOutWebservice()
{
$soap = new MockSoapClient(WSDL);
$sender = new Service($soap);
Expand All @@ -107,7 +107,7 @@ function testSoapAddNewRegistrationInteractingWithMockedOutWebservice()
* @expectedException Exception
* @expectedExceptionMessage Brugernavn / adgangskode er ikke korrekt
*/
function testSoapAddNewRegistrationInteractingWithOnlineWebserviceWithWrongCredentials()
public function testSoapAddNewRegistrationInteractingWithOnlineWebserviceWithWrongCredentials()
{
$soap = new \SoapClient(WSDL);
$sender = new Service($soap);
Expand All @@ -122,7 +122,7 @@ function testSoapAddNewRegistrationInteractingWithOnlineWebserviceWithWrongCrede
/**
* @group IntegrationTest
*/
function testSoapAddNewRegistrationInteractingWithOnlineWebservice()
public function testSoapAddNewRegistrationInteractingWithOnlineWebservice()
{
$soap = new \SoapClient(WSDL);
$sender = new Service($soap);
Expand Down
10 changes: 5 additions & 5 deletions tests/EDBBrugsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ class EDBBrugsTest extends \PHPUnit_Framework_TestCase
protected $password = 'adgangskode';
protected $school_code = '999999';

function setUp()
public function setUp()
{
$this->brugs = new Registration($this->username, $this->password, $this->school_code);
}

function tearDown()
public function tearDown()
{
unset($this->brugs);
}

function testConstructor()
public function testConstructor()
{
$this->assertTrue(is_object($this->brugs));
}

function testGetRequest()
public function testGetRequest()
{
$expected = '<?xml version="1.0"?>
<Tilmeldinger><User><Username>' . $this->username . '</Username><Passw>' . $this->password . '</Passw><Skolekode>' . $this->school_code . '</Skolekode></User></Tilmeldinger>
';
$this->assertEquals($expected, $this->brugs->getRequest());
}

function testGetRequestWithRegistrations()
public function testGetRequestWithRegistrations()
{
$expected = '<?xml version="1.0"?>
<Tilmeldinger><User><Username>' . $this->username . '</Username><Passw>' . $this->password . '</Passw><Skolekode>' . $this->school_code . '</Skolekode></User><Tilmelding><Elev.Fornavn>Svend Aage</Elev.Fornavn><Elev.Efternavn>Thomsen</Elev.Efternavn></Tilmelding><Tilmelding><Elev.Fornavn>Elev</Elev.Fornavn><Elev.Efternavn>H&#xF8;jskole</Elev.Efternavn></Tilmelding></Tilmeldinger>
Expand Down

0 comments on commit 381bc0c

Please sign in to comment.