Skip to content

Commit

Permalink
Fix for PHP7
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMadness committed Feb 14, 2018
1 parent ca3849b commit ff466d3
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace pwf\basic;

class Object
class BasicObject
{

/**
Expand Down
2 changes: 1 addition & 1 deletion framework/basic/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace pwf\basic;

abstract class Component extends Object implements \pwf\basic\interfaces\Component
abstract class Component extends BasicObject implements \pwf\basic\interfaces\Component
{
/**
* Force initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace pwf\components\eventhandler;

class ObjectDecorator extends \pwf\basic\Object implements interfaces\EventHandler
class BasicObjectDecorator extends \pwf\basic\BasicObject implements interfaces\EventHandler
{

use traits\EventTrait;
Expand Down
4 changes: 1 addition & 3 deletions tests/_support/_generated/AcceptanceTesterActions.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?php //[STAMP] cf8d5fa37e39ce59df4f4cd2a2c1f88c
<?php //[STAMP] 7342e6a097a6f93697a1c438e12213d1
namespace _generated;

// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile

use Helper\Acceptance;

trait AcceptanceTesterActions
{
/**
Expand Down
4 changes: 1 addition & 3 deletions tests/_support/_generated/FunctionalTesterActions.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?php //[STAMP] 525773c605ae90ee294676d694928c82
<?php //[STAMP] 8f438bd57792c93435e1e1cfc7771c71
namespace _generated;

// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile

use Helper\Functional;

trait FunctionalTesterActions
{
/**
Expand Down
90 changes: 81 additions & 9 deletions tests/_support/_generated/UnitTesterActions.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?php //[STAMP] 16f16f245c33e43c6c2c1fd5c0e0676c
<?php //[STAMP] 944b755085a310113b19d30e9d04d255
namespace _generated;

// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile

use Codeception\Module\Asserts;
use Helper\Unit;

trait UnitTesterActions
{
/**
Expand All @@ -19,29 +16,59 @@ abstract protected function getScenario();
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are equal.
* Checks that two variables are equal. If you're comparing floating-point values,
* you can specify the optional "delta" parameter which dictates how great of a precision
* error are you willing to tolerate in order to consider the two values equal.
*
* Regular example:
* ```php
* <?php
* $I->assertEquals($element->getChildrenCount(), 5);
* ```
*
* Floating-point example:
* ```php
* <?php
* $I->assertEquals($calculator->add(0.1, 0.2), 0.3, 'Calculator should add the two numbers correctly.', 0.01);
* ```
*
* @param $expected
* @param $actual
* @param string $message
* @param float $delta
* @see \Codeception\Module\Asserts::assertEquals()
*/
public function assertEquals($expected, $actual, $message = null) {
public function assertEquals($expected, $actual, $message = null, $delta = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that two variables are not equal
* Checks that two variables are not equal. If you're comparing floating-point values,
* you can specify the optional "delta" parameter which dictates how great of a precision
* error are you willing to tolerate in order to consider the two values not equal.
*
* Regular example:
* ```php
* <?php
* $I->assertNotEquals($element->getChildrenCount(), 0);
* ```
*
* Floating-point example:
* ```php
* <?php
* $I->assertNotEquals($calculator->add(0.1, 0.2), 0.4, 'Calculator should add the two numbers correctly.', 0.01);
* ```
*
* @param $expected
* @param $actual
* @param string $message
* @param float $delta
* @see \Codeception\Module\Asserts::assertNotEquals()
*/
public function assertNotEquals($expected, $actual, $message = null) {
public function assertNotEquals($expected, $actual, $message = null, $delta = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
}

Expand All @@ -54,7 +81,6 @@ public function assertNotEquals($expected, $actual, $message = null) {
* @param $expected
* @param $actual
* @param string $message
* @return mixed|void
* @see \Codeception\Module\Asserts::assertSame()
*/
public function assertSame($expected, $actual, $message = null) {
Expand Down Expand Up @@ -197,6 +223,36 @@ public function assertNotRegExp($pattern, $string, $message = null) {
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that a string starts with the given prefix.
*
* @param string $prefix
* @param string $string
* @param string $message
* @see \Codeception\Module\Asserts::assertStringStartsWith()
*/
public function assertStringStartsWith($prefix, $string, $message = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that a string doesn't start with the given prefix.
*
* @param string $prefix
* @param string $string
* @param string $message
* @see \Codeception\Module\Asserts::assertStringStartsNotWith()
*/
public function assertStringStartsNotWith($prefix, $string, $message = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
Expand Down Expand Up @@ -373,6 +429,22 @@ public function assertArrayNotHasKey($key, $actual, $description = null) {
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that array contains subset.
*
* @param array $subset
* @param array $array
* @param bool $strict
* @param string $message
* @see \Codeception\Module\Asserts::assertArraySubset()
*/
public function assertArraySubset($subset, $array, $strict = null, $message = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArraySubset', func_get_args()));
}


/**
* [!] Method is generated. Documentation taken from corresponding module.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/CallbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function testDecorator()
return true;
}
]);
$decorated = new \pwf\components\eventhandler\ObjectDecorator();
$decorated = new \pwf\components\eventhandler\BasicObjectDecorator();
$this->assertEquals($obj, $decorated->setObject($obj)->getObject());
$this->assertTrue($decorated->getView());
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/ObjectTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class ObjectTestClass extends pwf\basic\Object
class BasicObjectTestClass extends pwf\basic\BasicObject
{
private $field;

Expand All @@ -20,7 +20,7 @@ class ObjectTest extends \PHPUnit_Framework_TestCase

public function testObject()
{
$o = new ObjectTestClass();
$o = new BasicObjectTestClass();
$o->field = 'test';
$this->assertEquals('testtest1', $o->field);

Expand Down

0 comments on commit ff466d3

Please sign in to comment.