@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class LtTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testLtWithFirstArgIsLessThanSecondOne() |
|
| 10 | - { |
|
| 9 | + public function testLtWithFirstArgIsLessThanSecondOne() |
|
| 10 | + { |
|
| 11 | 11 | $firstArg = 1; |
| 12 | 12 | $secondArg = 2; |
| 13 | 13 | $actual = lt($firstArg)($secondArg); |
| 14 | 14 | $this->assertTrue($actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testLtWithFirstArgIsEqualToSecondOne() |
|
| 18 | - { |
|
| 17 | + public function testLtWithFirstArgIsEqualToSecondOne() |
|
| 18 | + { |
|
| 19 | 19 | $firstArg = 2; |
| 20 | 20 | $secondArg = 2; |
| 21 | 21 | $actual = lt($firstArg)($secondArg); |
| 22 | 22 | $this->assertFalse($actual); |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function testLtWithFirstArgIsGreaterThanSecondOne() |
|
| 26 | - { |
|
| 25 | + public function testLtWithFirstArgIsGreaterThanSecondOne() |
|
| 26 | + { |
|
| 27 | 27 | $firstArg = 3; |
| 28 | 28 | $secondArg = 2; |
| 29 | 29 | $actual = lt($firstArg)($secondArg); |
| 30 | 30 | $this->assertFalse($actual); |
| 31 | - } |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class LteTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testLteWithFirstArgIsLessThanSecondOne() |
|
| 10 | - { |
|
| 9 | + public function testLteWithFirstArgIsLessThanSecondOne() |
|
| 10 | + { |
|
| 11 | 11 | $firstArg = 1; |
| 12 | 12 | $secondArg = 2; |
| 13 | 13 | $actual = lte($firstArg)($secondArg); |
| 14 | 14 | $this->assertTrue($actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testLteWithFirstArgIsEqualToSecondOne() |
|
| 18 | - { |
|
| 17 | + public function testLteWithFirstArgIsEqualToSecondOne() |
|
| 18 | + { |
|
| 19 | 19 | $firstArg = 2; |
| 20 | 20 | $secondArg = 2; |
| 21 | 21 | $actual = lte($firstArg)($secondArg); |
| 22 | 22 | $this->assertTrue($actual); |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function testLteWithFirstArgIsGreaterThanSecondOne() |
|
| 26 | - { |
|
| 25 | + public function testLteWithFirstArgIsGreaterThanSecondOne() |
|
| 26 | + { |
|
| 27 | 27 | $firstArg = 3; |
| 28 | 28 | $secondArg = 2; |
| 29 | 29 | $actual = lte($firstArg)($secondArg); |
| 30 | 30 | $this->assertFalse($actual); |
| 31 | - } |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | |
| 7 | 7 | class TailTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testTail() |
|
| 10 | - { |
|
| 9 | + public function testTail() |
|
| 10 | + { |
|
| 11 | 11 | $argument = [1, 2, 3, 4, 5]; |
| 12 | 12 | $expect = 5; |
| 13 | 13 | $actual = tail()($argument); |
| 14 | 14 | $this->assertEquals($expect, $actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testTailWithEmptyArray() |
|
| 18 | - { |
|
| 17 | + public function testTailWithEmptyArray() |
|
| 18 | + { |
|
| 19 | 19 | $argument = []; |
| 20 | 20 | $actual = tail()($argument); |
| 21 | 21 | $this->assertNull($actual); |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | } |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | |
| 7 | 7 | class FirstTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testFirst() |
|
| 10 | - { |
|
| 9 | + public function testFirst() |
|
| 10 | + { |
|
| 11 | 11 | $argument = [1, 2, 3, 4, 5]; |
| 12 | 12 | $expect = 1; |
| 13 | 13 | $actual = first()($argument); |
| 14 | 14 | $this->assertEquals($expect, $actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testFirstWithEmptyArray() |
|
| 18 | - { |
|
| 17 | + public function testFirstWithEmptyArray() |
|
| 18 | + { |
|
| 19 | 19 | $argument = []; |
| 20 | 20 | $actual = first()($argument); |
| 21 | 21 | $this->assertNull($actual); |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | } |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | |
| 7 | 7 | class HeadTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testHead() |
|
| 10 | - { |
|
| 9 | + public function testHead() |
|
| 10 | + { |
|
| 11 | 11 | $argument = [1, 2, 3, 4, 5]; |
| 12 | 12 | $expect = 1; |
| 13 | 13 | $actual = head()($argument); |
| 14 | 14 | $this->assertEquals($expect, $actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testHeadWithEmptyArray() |
|
| 18 | - { |
|
| 17 | + public function testHeadWithEmptyArray() |
|
| 18 | + { |
|
| 19 | 19 | $argument = []; |
| 20 | 20 | $actual = head()($argument); |
| 21 | 21 | $this->assertNull($actual); |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | } |
@@ -6,19 +6,19 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ContainsTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testArrayContainsItem() |
|
| 10 | - { |
|
| 9 | + public function testArrayContainsItem() |
|
| 10 | + { |
|
| 11 | 11 | $item = 1; |
| 12 | 12 | $array = [1, 2, 3, 4, 5]; |
| 13 | 13 | $actual = contains($item)($array); |
| 14 | 14 | $this->assertTrue($actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testArrayDoesNotContainItem() |
|
| 18 | - { |
|
| 17 | + public function testArrayDoesNotContainItem() |
|
| 18 | + { |
|
| 19 | 19 | $item = 1; |
| 20 | 20 | $array = [2, 3, 4, 5]; |
| 21 | 21 | $actual = contains($item)($array); |
| 22 | 22 | $this->assertFalse($actual); |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | } |
@@ -6,19 +6,19 @@ |
||
| 6 | 6 | |
| 7 | 7 | class DefaultToTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testDefaultToAndGetDefaultValue() |
|
| 10 | - { |
|
| 9 | + public function testDefaultToAndGetDefaultValue() |
|
| 10 | + { |
|
| 11 | 11 | $value = null; |
| 12 | 12 | $defaultValue = 10; |
| 13 | 13 | $actual = defaultTo($defaultValue)($value); |
| 14 | 14 | $this->assertEquals($defaultValue, $actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testDefaultToAndGetInputValue() |
|
| 18 | - { |
|
| 17 | + public function testDefaultToAndGetInputValue() |
|
| 18 | + { |
|
| 19 | 19 | $value = 50; |
| 20 | 20 | $defaultValue = 10; |
| 21 | 21 | $actual = defaultTo($defaultValue)($value); |
| 22 | 22 | $this->assertEquals($value, $actual); |
| 23 | - } |
|
| 23 | + } |
|
| 24 | 24 | } |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | |
| 4 | 4 | function defaultTo() |
| 5 | 5 | { |
| 6 | - $defaultTo = function ($defaultValue, $value) { |
|
| 6 | + $defaultTo = function ($defaultValue, $value) { |
|
| 7 | 7 | return $value ? $value : $defaultValue; |
| 8 | - }; |
|
| 9 | - $arguments = func_get_args(); |
|
| 10 | - $curried = curryN($defaultTo, 2); |
|
| 11 | - return call_user_func_array($curried, $arguments); |
|
| 8 | + }; |
|
| 9 | + $arguments = func_get_args(); |
|
| 10 | + $curried = curryN($defaultTo, 2); |
|
| 11 | + return call_user_func_array($curried, $arguments); |
|
| 12 | 12 | } |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | function defaultTo() |
| 5 | 5 | { |
| 6 | - $defaultTo = function ($defaultValue, $value) { |
|
| 6 | + $defaultTo = function($defaultValue, $value) { |
|
| 7 | 7 | return $value ? $value : $defaultValue; |
| 8 | 8 | }; |
| 9 | 9 | $arguments = func_get_args(); |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | |
| 7 | 7 | class LastTest extends TestCase |
| 8 | 8 | { |
| 9 | - public function testLast() |
|
| 10 | - { |
|
| 9 | + public function testLast() |
|
| 10 | + { |
|
| 11 | 11 | $argument = [1, 2, 3, 4, 5]; |
| 12 | 12 | $expect = 5; |
| 13 | 13 | $actual = last()($argument); |
| 14 | 14 | $this->assertEquals($expect, $actual); |
| 15 | - } |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function testLastWithEmptyArray() |
|
| 18 | - { |
|
| 17 | + public function testLastWithEmptyArray() |
|
| 18 | + { |
|
| 19 | 19 | $argument = []; |
| 20 | 20 | $actual = last()($argument); |
| 21 | 21 | $this->assertNull($actual); |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | } |