From: Alangi Derick Date: Tue, 20 Nov 2018 16:35:47 +0000 (+0100) Subject: Add PHPUnit tests for methods in ViewAction::class X-Git-Tag: 1.34.0-rc.0~3275^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=5d8fda717d556aefaa0154928d35288a7d98f23f;p=lhc%2Fweb%2Fwiklou.git Add PHPUnit tests for methods in ViewAction::class * makeViewActionClassFactory() - helper function to create an instance of the ViewAction class and return it. * testGetName() - covers the getName() method in ViewAction class. * testOnView() - covers the onView() method in ViewAction class. Change-Id: I1c84c8f51d96386196a1c0b44a209f90ddd8e716 --- diff --git a/tests/phpunit/includes/actions/ViewActionTest.php b/tests/phpunit/includes/actions/ViewActionTest.php new file mode 100644 index 0000000000..5f659c07a2 --- /dev/null +++ b/tests/phpunit/includes/actions/ViewActionTest.php @@ -0,0 +1,35 @@ +makeViewActionClassFactory(); + $actual = $viewAction->getName(); + + $this->assertSame( 'view', $actual ); + } + + public function testOnView() { + $viewAction = $this->makeViewActionClassFactory(); + $actual = $viewAction->onView(); + + $this->assertNull( $actual ); + } +}