mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
composer.json - move tests-related classes to "autoload-dev" section (used for development purposes only and avoid polluting the autoloader in production)
This commit is contained in:
33
tests/Utilities/Reflection/A.php
Normal file
33
tests/Utilities/Reflection/A.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
||||
|
||||
/**
|
||||
* The A class.
|
||||
* Used for testing the Reflection class.
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class A
|
||||
{
|
||||
use E;
|
||||
|
||||
private $count = 1;
|
||||
|
||||
protected function lorem()
|
||||
{
|
||||
return 'ipsum';
|
||||
}
|
||||
|
||||
protected function getCount()
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
}
|
||||
26
tests/Utilities/Reflection/B.php
Normal file
26
tests/Utilities/Reflection/B.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
||||
|
||||
/**
|
||||
* The B class.
|
||||
* Used for testing the Reflection class.
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class B extends A
|
||||
{
|
||||
protected $name = 'Lorem Ipsum';
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
29
tests/Utilities/Reflection/C.php
Normal file
29
tests/Utilities/Reflection/C.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
||||
|
||||
/**
|
||||
* The C class.
|
||||
* Used for testing the Reflection class.
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class C extends B
|
||||
{
|
||||
public function getPositive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getNegative()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
20
tests/Utilities/Reflection/D.php
Normal file
20
tests/Utilities/Reflection/D.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
||||
|
||||
/**
|
||||
* The D class.
|
||||
* Used for testing the Reflection class.
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class D
|
||||
{
|
||||
}
|
||||
20
tests/Utilities/Reflection/E.php
Normal file
20
tests/Utilities/Reflection/E.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
||||
|
||||
/**
|
||||
* The E trait.
|
||||
* Used for testing the Reflection class.
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
trait E
|
||||
{
|
||||
}
|
||||
54
tests/Utilities/Reflection/F.php
Normal file
54
tests/Utilities/Reflection/F.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
||||
|
||||
/**
|
||||
* The F class.
|
||||
* Used for testing the Reflection class.
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class F
|
||||
{
|
||||
protected $username;
|
||||
private $accountBalance;
|
||||
private $city;
|
||||
private $country;
|
||||
private $gInstance;
|
||||
|
||||
public function __construct($accountBalance, $city, $country, $username, $firstName = 'John', $lastName = 'Scott')
|
||||
{
|
||||
$this->accountBalance = $accountBalance;
|
||||
$this->city = $city;
|
||||
$this->country = $country;
|
||||
$this->username = $username;
|
||||
$this->gInstance = new G($firstName, $lastName);
|
||||
|
||||
/*
|
||||
* Called to avoid "Unused private method getAccountBalance" warning only
|
||||
*/
|
||||
$this->getAccountBalance();
|
||||
}
|
||||
|
||||
public function getCountry()
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
protected function getCity()
|
||||
{
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
private function getAccountBalance()
|
||||
{
|
||||
return $this->accountBalance;
|
||||
}
|
||||
}
|
||||
38
tests/Utilities/Reflection/G.php
Normal file
38
tests/Utilities/Reflection/G.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\Common\Test\Utilities\Reflection;
|
||||
|
||||
/**
|
||||
* The G class.
|
||||
* Used for testing the Reflection class.
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class G
|
||||
{
|
||||
private $firstName;
|
||||
private $lastName;
|
||||
|
||||
public function __construct($firstName = 'John', $lastName = 'Scott')
|
||||
{
|
||||
$this->firstName = $firstName;
|
||||
$this->lastName = $lastName;
|
||||
}
|
||||
|
||||
public function getFirstName()
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user