mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-13 01:51:50 +01:00
Reformat code automatically
This commit is contained in:
@@ -33,6 +33,17 @@ class BaseTestCaseTraitTest extends BaseTestCase
|
||||
{
|
||||
use BaseTestCaseTrait;
|
||||
|
||||
public function testAssertConstructorVisibilityAndArgumentsUsingClassWithoutConstructor(): void
|
||||
{
|
||||
$this->expectException(ClassWithoutConstructorException::class);
|
||||
static::assertConstructorVisibilityAndArguments(SimpleTestCase::class, OopVisibilityType::IS_PUBLIC);
|
||||
}
|
||||
|
||||
public function testAssertHasNoConstructor(): void
|
||||
{
|
||||
static::assertHasNoConstructor(SimpleTestCase::class);
|
||||
}
|
||||
|
||||
public function testAssertMethodVisibility(): void
|
||||
{
|
||||
$method = new ReflectionMethod(SimpleTestCase::class, 'assertMethodVisibility');
|
||||
@@ -53,54 +64,6 @@ class BaseTestCaseTraitTest extends BaseTestCase
|
||||
static::assertMethodVisibility($method, OopVisibilityType::IS_PRIVATE);
|
||||
}
|
||||
|
||||
public function testAssertConstructorVisibilityAndArgumentsUsingClassWithoutConstructor(): void
|
||||
{
|
||||
$this->expectException(ClassWithoutConstructorException::class);
|
||||
static::assertConstructorVisibilityAndArguments(SimpleTestCase::class, OopVisibilityType::IS_PUBLIC);
|
||||
}
|
||||
|
||||
public function testAssertHasNoConstructor(): void
|
||||
{
|
||||
static::assertHasNoConstructor(SimpleTestCase::class);
|
||||
}
|
||||
|
||||
public function testProvideEmptyValue(): void
|
||||
{
|
||||
$testCase = new SimpleTestCase();
|
||||
$values = $testCase->provideEmptyValue();
|
||||
|
||||
$expected = [
|
||||
[''],
|
||||
[' '],
|
||||
[null],
|
||||
[0],
|
||||
[false],
|
||||
[[]],
|
||||
];
|
||||
|
||||
foreach ($values as $index => $value) {
|
||||
static::assertSame($expected[$index], $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function testProvideEmptyScalarValue(): void
|
||||
{
|
||||
$testCase = new SimpleTestCase();
|
||||
$values = $testCase->provideEmptyScalarValue();
|
||||
|
||||
$expected = [
|
||||
[''],
|
||||
[' '],
|
||||
[null],
|
||||
[0],
|
||||
[false],
|
||||
];
|
||||
|
||||
foreach ($values as $index => $value) {
|
||||
static::assertSame($expected[$index], $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function testProvideBooleanValue(): void
|
||||
{
|
||||
$testCase = new SimpleTestCase();
|
||||
@@ -164,19 +127,40 @@ class BaseTestCaseTraitTest extends BaseTestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testProvideNotExistingFilePath(): void
|
||||
public function testProvideEmptyScalarValue(): void
|
||||
{
|
||||
$testCase = new SimpleTestCase();
|
||||
$paths = $testCase->provideNotExistingFilePath();
|
||||
$values = $testCase->provideEmptyScalarValue();
|
||||
|
||||
$expected = [
|
||||
['lets-test.doc'],
|
||||
['lorem/ipsum.jpg'],
|
||||
['surprise/me/one/more/time.txt'],
|
||||
[''],
|
||||
[' '],
|
||||
[null],
|
||||
[0],
|
||||
[false],
|
||||
];
|
||||
|
||||
foreach ($paths as $index => $path) {
|
||||
static::assertSame($expected[$index], $path);
|
||||
foreach ($values as $index => $value) {
|
||||
static::assertSame($expected[$index], $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function testProvideEmptyValue(): void
|
||||
{
|
||||
$testCase = new SimpleTestCase();
|
||||
$values = $testCase->provideEmptyValue();
|
||||
|
||||
$expected = [
|
||||
[''],
|
||||
[' '],
|
||||
[null],
|
||||
[0],
|
||||
[false],
|
||||
[[]],
|
||||
];
|
||||
|
||||
foreach ($values as $index => $value) {
|
||||
static::assertSame($expected[$index], $value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,4 +179,20 @@ class BaseTestCaseTraitTest extends BaseTestCase
|
||||
static::assertEquals($expected[$index], $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function testProvideNotExistingFilePath(): void
|
||||
{
|
||||
$testCase = new SimpleTestCase();
|
||||
$paths = $testCase->provideNotExistingFilePath();
|
||||
|
||||
$expected = [
|
||||
['lets-test.doc'],
|
||||
['lorem/ipsum.jpg'],
|
||||
['surprise/me/one/more/time.txt'],
|
||||
];
|
||||
|
||||
foreach ($paths as $index => $path) {
|
||||
static::assertSame($expected[$index], $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user