for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Cubiche package.
*
* Copyright (c) Cubiche
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cubiche\Core\Selector\Tests\Units;
* MethodTests class.
* @author Ivannis Suárez Jerez <[email protected]>
class MethodTests extends FieldTestCase
{
* @return bool
public function methodTrue()
return true;
}
public function methodFalse()
return false;
* @param number $arg1
* @param number $arg2
* @return number
public function methodWithArgs($arg1, $arg2)
return $arg1 + $arg2;
protected function privateMethod()
* Test apply.
public function testApply()
$this
->given($method = $this->newTestedInstance('name'))
->then()
->string($method->apply($method))
->isEqualTo('name')
;
->given($method = $this->newTestedInstance('methodWithArgs'))
->integer($method->with(1, 2)->apply($this))
->isEqualTo(3)
->given($method = $this->newTestedInstance('foo'))
->exception(function () use ($method) {
$method->apply(null);
})->isInstanceOf(\RuntimeException::class)
$method->apply($this);
->given($method = $this->newTestedInstance('privateMethod'))