Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding standard fixes for the tests #8

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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