Skip to content

Commit

Permalink
Update PHPUnit to 9.5 (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanNerd authored Dec 10, 2020
1 parent 1024d48 commit f50cc93
Show file tree
Hide file tree
Showing 29 changed files with 632 additions and 176 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"seld/cli-prompt": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7.16",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^9.5.0",
"mockery/mockery": "^1.4.2",
"mikey179/vfsstream": "^1.4"
},
"suggest": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Package Test Suite">
Expand Down
75 changes: 60 additions & 15 deletions tests/Animation/AnimationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ protected function assertExitedRight()
$this->runAsc('exitRightFrameEnd', 9);
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_exit_to_top()
{
$this->fullArtExitTop();
Expand All @@ -106,7 +109,10 @@ public function it_can_exit_to_top()
$this->cli->animation('404', $this->getSleeper(11))->exitTo('top');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_enter_from_top()
{
$this->emptyFrame();
Expand All @@ -118,7 +124,10 @@ public function it_can_enter_from_top()
$this->cli->animation('404', $this->getSleeper(11))->enterFrom('top');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_exit_to_bottom()
{
$this->fullArtExitBottom();
Expand All @@ -131,7 +140,10 @@ public function it_can_exit_to_bottom()
$this->cli->animation('404', $this->getSleeper(11))->exitTo('bottom');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_enter_from_bottom()
{
$this->emptyFrame();
Expand All @@ -143,7 +155,10 @@ public function it_can_enter_from_bottom()
$this->cli->animation('404', $this->getSleeper(11))->enterFrom('bottom');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_exit_to_left()
{
$this->fullArtExitLeft();
Expand All @@ -155,7 +170,10 @@ public function it_can_exit_to_left()
$this->cli->animation('4', $this->getSleeper(14))->exitTo('left');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_enter_from_left()
{
$this->assertEnteredFromLeft();
Expand All @@ -165,7 +183,10 @@ public function it_can_enter_from_left()
$this->cli->animation('4', $this->getSleeper(14))->enterFrom('left');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_exit_to_right()
{
$this->fullArtExitRight();
Expand All @@ -177,7 +198,10 @@ public function it_can_exit_to_right()
$this->cli->animation('4', $this->getSleeper(85))->exitTo('right');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_enter_from_right()
{
$this->enterRightFrame1();
Expand All @@ -188,7 +212,10 @@ public function it_can_enter_from_right()
$this->cli->animation('4', $this->getSleeper(85))->enterFrom('right');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_will_scroll_to_the_right_by_default()
{
$this->assertScrolledRight();
Expand All @@ -197,7 +224,10 @@ public function it_will_scroll_to_the_right_by_default()
$this->cli->animation('4', $this->getSleeper(91))->scroll();
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_scroll_to_the_right()
{
$this->assertScrolledRight();
Expand All @@ -206,7 +236,10 @@ public function it_can_scroll_to_the_right()
$this->cli->animation('4', $this->getSleeper(91))->scroll('right');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_scroll_to_the_left()
{
$this->emptyFrame();
Expand All @@ -219,7 +252,10 @@ public function it_can_scroll_to_the_left()
$this->cli->animation('4', $this->getSleeper(91))->scroll('left');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_scroll_up()
{
$this->emptyFrame();
Expand All @@ -233,7 +269,10 @@ public function it_can_scroll_up()
$this->cli->animation('404', $this->getSleeper(13))->scroll('up');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_scroll_down()
{
$this->emptyFrame();
Expand All @@ -247,7 +286,10 @@ public function it_can_scroll_down()
$this->cli->animation('404', $this->getSleeper(13))->scroll('down');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_run_a_directory_animation()
{
$this->runAsc('runFrames', 5);
Expand All @@ -257,7 +299,10 @@ public function it_can_run_a_directory_animation()
}


/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_404s_when_it_gets_invalid_art()
{
$this->emptyFrame();
Expand Down
27 changes: 17 additions & 10 deletions tests/AnsiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use League\CLImate\Decorator\Parser\ParserFactory;
use League\CLImate\Decorator\Style;
use League\CLImate\Decorator\Tags;
use League\CLImate\TerminalObject;
use League\CLImate\TerminalObject\Router\BasicRouter;
use League\CLImate\Util\System\Linux;
use League\CLImate\Util\System\Windows;
Expand All @@ -15,16 +16,17 @@

class AnsiTest extends TestBase
{
/** @test */

/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_output_with_ansi()
{
$router = new BasicRouter();
$router->output($this->output);

$style = new Style();
$parser = new Ansi($style->current(), new Tags($style->all()));

$obj = Mockery::mock('League\CLImate\TerminalObject');
$obj->shouldReceive('result')->once()->andReturn("<green>I am green</green>");
$obj->shouldReceive('sameLine')->once()->andReturn(false);
Expand All @@ -37,8 +39,10 @@ public function it_can_output_with_ansi()
$router->execute($obj);
}

/** @test */

/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_output_without_ansi()
{
$router = new BasicRouter();
Expand All @@ -60,7 +64,6 @@ public function it_can_output_without_ansi()
}

/** @test */

public function it_will_recognize_non_ansi_systems()
{
$system = Mockery::mock('League\CLImate\Util\System\Windows');
Expand All @@ -71,8 +74,10 @@ public function it_will_recognize_non_ansi_systems()
$this->assertInstanceOf('League\CLImate\Decorator\Parser\NonAnsi', $parser);
}

/** @test */

/**
* @test
* @doesNotPerformAssertions
*/
public function it_will_force_ansi_on_a_non_ansi_system()
{
$system = new Windows();
Expand All @@ -86,8 +91,10 @@ public function it_will_force_ansi_on_a_non_ansi_system()
$this->cli->out("<green>I am green</green>");
}

/** @test */

/**
* @test
* @doesNotPerformAssertions
*/
public function it_will_force_ansi_off_on_an_ansi_system()
{
$system = new Linux();
Expand Down
2 changes: 1 addition & 1 deletion tests/Argument/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ManagerTest extends TestCase
{
private $manager;

public function setUp()
public function setUp(): void
{
$this->manager = new Manager;
}
Expand Down
20 changes: 16 additions & 4 deletions tests/BorderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,43 @@

class BorderTest extends TestBase
{
/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_output_a_basic_border()
{
$this->shouldWrite("\e[m" . str_repeat('-', $this->util->width() ?: 100) . "\e[0m");
$this->shouldHavePersisted();
$this->cli->border();
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_output_a_border_with_a_different_character()
{
$this->shouldWrite("\e[m" . str_repeat('@', $this->util->width() ?: 100) . "\e[0m");
$this->shouldHavePersisted();
$this->cli->border('@');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_output_a_border_with_a_different_length()
{
$this->shouldWrite("\e[m" . str_repeat('-', 60) . "\e[0m");
$this->shouldHavePersisted();
$this->cli->border('-', 60);
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_output_a_border_with_an_odd_length_character_and_still_be_the_correct_length()
{
$this->shouldWrite("\e[m-*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*\e[0m");
Expand Down
25 changes: 20 additions & 5 deletions tests/BrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

class BrTest extends TestBase
{
/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_output_a_line_break()
{
$this->shouldWrite("\e[m\e[0m");
Expand All @@ -13,7 +16,10 @@ public function it_can_output_a_line_break()
$this->cli->br();
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_is_chainable()
{
$this->shouldWrite("\e[m\e[0m");
Expand All @@ -23,7 +29,10 @@ public function it_is_chainable()
$this->cli->br()->out('This is a line further down.');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_can_accept_the_number_of_breaks_as_an_argument()
{
$this->shouldWrite("\e[m\e[0m", 3);
Expand All @@ -33,7 +42,10 @@ public function it_can_accept_the_number_of_breaks_as_an_argument()
$this->cli->br(3)->out('This is a line further down.');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_will_ignore_a_negative_number_of_breaks()
{
$this->shouldWrite("\e[m\e[0m");
Expand All @@ -43,7 +55,10 @@ public function it_will_ignore_a_negative_number_of_breaks()
$this->cli->br(-3)->out('This is a line further down.');
}

/** @test */
/**
* @test
* @doesNotPerformAssertions
*/
public function it_will_ignore_a_partial_number_of_breaks()
{
$this->shouldWrite("\e[m\e[0m", 4);
Expand Down
Loading

0 comments on commit f50cc93

Please sign in to comment.