diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Template/Filter/FactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Template/Filter/FactoryTest.php index 93c3afc25a7fe2e511a8d26b9931a2a39f77a268..ec50e2fcbc476c73b2a5fedbe264f782f09a2de0 100755 --- a/app/code/Magento/Catalog/Test/Unit/Model/Template/Filter/FactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Template/Filter/FactoryTest.php @@ -18,7 +18,9 @@ class FactoryTest extends \PHPUnit_Framework_TestCase protected $_factory; /** - * Setup + * SetUp method + * + * @return void */ protected function setUp() { @@ -33,6 +35,8 @@ class FactoryTest extends \PHPUnit_Framework_TestCase /** * Test create + * + * @return void */ public function testCreate() { @@ -55,6 +59,8 @@ class FactoryTest extends \PHPUnit_Framework_TestCase /** * Test create with arguments + * + * @return void */ public function testCreateWithArguments() { @@ -77,6 +83,8 @@ class FactoryTest extends \PHPUnit_Framework_TestCase } /** + * Test wrong type exception + * * @expectedException \Magento\Framework\Exception\LocalizedException * @expectedExceptionMessage WrongClass doesn't extend \Magento\Framework\Filter\Template * @return void diff --git a/app/code/Magento/Checkout/Test/Unit/Controller/Onepage/SaveBillingTest.php b/app/code/Magento/Checkout/Test/Unit/Controller/Onepage/SaveBillingTest.php index db14585d07495e6a39f49fc597f7e5544dc5866e..f1a5b1c882dac2aee11c342f53ed2424c5ec0b9a 100755 --- a/app/code/Magento/Checkout/Test/Unit/Controller/Onepage/SaveBillingTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Controller/Onepage/SaveBillingTest.php @@ -80,7 +80,9 @@ class SaveBillingTest extends \PHPUnit_Framework_TestCase protected $resultJson; /** - * Setup + * SetUp method + * + * @return void */ protected function setUp() { @@ -171,6 +173,8 @@ class SaveBillingTest extends \PHPUnit_Framework_TestCase /** * Test execute + * + * @return void */ public function testExecute() { @@ -190,6 +194,8 @@ class SaveBillingTest extends \PHPUnit_Framework_TestCase /** * Test validate minimum amount + * + * @return void */ public function testValidateMinimumAmount() { @@ -265,6 +271,8 @@ class SaveBillingTest extends \PHPUnit_Framework_TestCase /** * Test validate minimum amount negative + * + * @return void */ public function testValidateMinimumAmountNegative() { diff --git a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Edit/FormTest.php b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Edit/FormTest.php index 731904fba697eff17003df52a01008bdcd9f328c..9fd408462cfc6a5918fa511605c160c3ad05c7fd 100755 --- a/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Edit/FormTest.php +++ b/app/code/Magento/Cms/Test/Unit/Block/Adminhtml/Block/Edit/FormTest.php @@ -133,6 +133,8 @@ class FormTest extends \PHPUnit_Framework_TestCase /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. + * + * @return void */ public function setUp() { @@ -213,6 +215,8 @@ class FormTest extends \PHPUnit_Framework_TestCase /** * Test prepare form model has no block id and single store mode is on + * + * @return void */ public function testPrepareFormModelHasNoBlockIdAndSingleStoreMode() { @@ -241,6 +245,8 @@ class FormTest extends \PHPUnit_Framework_TestCase /** * Test prepare form model has block id and signle store mode is off + * + * @return void */ public function testPrepareFormModelHasBlockIdAndNonSingleStoreMode() { diff --git a/app/code/Magento/Eav/Test/Unit/Model/Attribute/GroupRepositoryTest.php b/app/code/Magento/Eav/Test/Unit/Model/Attribute/GroupRepositoryTest.php index d590fbc0fad23d6f13ed644e0a0103f1c6298391..41dc92df72f0fdcc2c8b21dd868934e55d3427c5 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Attribute/GroupRepositoryTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Attribute/GroupRepositoryTest.php @@ -37,6 +37,11 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase */ protected $groupListFactoryMock; + /** + * SetUp method + * + * @return void + */ protected function setUp() { $this->groupResourceMock = $this->getMock( @@ -82,6 +87,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase ); } + /** + * Test saving if object is new + * + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + * @return void + */ public function testSaveIfObjectNew() { $attributeSetId = 42; @@ -100,6 +112,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase $this->assertEquals($groupMock, $this->model->save($groupMock)); } + /** + * Test saving if object is not new + * + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + * @return void + */ public function testSaveIfObjectNotNew() { $attributeSetId = 42; @@ -127,8 +146,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test saving throws exception if attribute set does not exist + * * @expectedException \Magento\Framework\Exception\NoSuchEntityException * @expectedExceptionMessage No such entity with attributeSetId = -1 + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + * @return void */ public function testSaveThrowExceptionIfAttributeSetDoesNotExist() { @@ -147,8 +171,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test saving throws exception if cannot save group + * * @expectedException \Magento\Framework\Exception\StateException * @expectedExceptionMessage Cannot save attributeGroup + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + * @return void */ public function testSaveThrowExceptionIfCannotSaveGroup() { @@ -170,8 +199,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test saving throws exception if group does not belong to provided set + * * @expectedException \Magento\Framework\Exception\StateException * @expectedExceptionMessage Attribute group does not belong to provided attribute set + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + * @return void */ public function testSaveThrowExceptionIfGroupDoesNotBelongToProvidedSet() { @@ -192,8 +226,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test saving throws exception if provided group does not exist + * * @expectedException \Magento\Framework\Exception\NoSuchEntityException * @expectedExceptionMessage No such entity with attributeGroupId = + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + * @return void */ public function testSaveThrowExceptionIfProvidedGroupDoesNotExist() { @@ -213,6 +252,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase $this->model->save($groupMock); } + /** + * Test get list + * + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void + */ public function testGetList() { $attributeSetId = 'filter'; @@ -261,8 +307,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test get list with invalid input exception + * * @expectedException \Magento\Framework\Exception\InputException * @expectedExceptionMessage attribute_set_id is a required field. + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ public function testGetListWithInvalidInputException() { @@ -272,8 +323,13 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test get list with no such entity exception + * * @expectedException \Magento\Framework\Exception\NoSuchEntityException * @expectedExceptionMessage No such entity with attributeSetId = filter + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ public function testGetListWithNoSuchEntityException() { @@ -296,6 +352,12 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase $this->model->getList($searchCriteriaMock); } + /** + * Test get + * + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void + */ public function testGet() { $groupId = 42; @@ -307,8 +369,12 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test get throws exception if provided group does not exist + * * @expectedException \Magento\Framework\Exception\NoSuchEntityException * @expectedExceptionMessage Group with id "42" does not exist. + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @return void */ public function testGetThrowExceptionIfProvidedGroupDoesNotExist() { @@ -320,6 +386,12 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase $this->assertEquals($groupMock, $this->model->get($groupId)); } + /** + * Test delete + * + * @throws \Magento\Framework\Exception\StateException + * @return void + */ public function testDelete() { $groupMock = $this->getMock('\Magento\Eav\Model\Entity\Attribute\Group', [], [], '', false); @@ -328,8 +400,12 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase } /** + * Test deletion throws exception if provided group does not exist + * * @expectedException \Magento\Framework\Exception\StateException * @expectedExceptionMessage Cannot delete attributeGroup with id + * @throws \Magento\Framework\Exception\StateException + * @return void */ public function testDeleteThrowExceptionIfProvidedGroupDoesNotExist() { @@ -342,6 +418,11 @@ class GroupRepositoryTest extends \PHPUnit_Framework_TestCase $this->model->delete($groupMock); } + /** + * Test delete by id + * + * @return void + */ public function testDeleteById() { $groupId = 42; diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php index 3154697b9994f9cb4f802eabf3ece78c4b6355d8..b7b8759dfc4016b42702cb84f7e7c5b7ed76bbba 100755 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php @@ -76,7 +76,9 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase protected $resultRawMock; /** - * Setup + * SetUp method + * + * @return void */ public function setUp() { @@ -149,6 +151,8 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase /** * Test execute module exception + * + * @return void */ public function testExecuteModelException() { @@ -175,6 +179,8 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase /** * Test execute exception + * + * @return void */ public function testExecuteException() { @@ -201,6 +207,8 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase /** * Test execute no comment + * + * @return void */ public function testExecuteNoComment() { @@ -228,6 +236,8 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase /** * Test execute + * + * @return void */ public function testExecute() { diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php index 9e1a67276ec744df856c79344928df211c276efb..7b6c366e5eceaa2e21cdb8ab146ffe1ac547a752 100644 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Creditmemo/UpdateQtyTest.php @@ -96,6 +96,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase */ protected $resultRawMock; + /** + * Set up method + * + * @return void + */ public function setUp() { $this->creditmemoMock = $this->getMockBuilder('Magento\Sales\Model\Order\Creditmemo') @@ -189,6 +194,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase ); } + /** + * Test execute model exception + * + * @return void + */ public function testExecuteModelException() { $message = 'Model exception'; @@ -215,6 +225,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase ); } + /** + * Test execute exception + * + * @return void + */ public function testExecuteException() { $message = 'Cannot update the item\'s quantity.'; @@ -241,6 +256,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase ); } + /** + * Test execute + * + * @return void + */ public function testExecute() { $response = 'output'; diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php index d78ec1317d9339a11e93fa1d56c6e19894bd4c65..4d4b43edcd48998291da96e62017a96dab3df228 100755 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/AddCommentTest.php @@ -79,6 +79,11 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase */ protected $resultJsonMock; + /** + * SetUp method + * + * @return void + */ public function setUp() { $objectManager = new ObjectManager($this); @@ -177,6 +182,11 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase ); } + /** + * Test execute + * + * @return void + */ public function testExecute() { $data = ['comment' => 'test comment']; @@ -255,6 +265,11 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase $this->assertSame($resultRaw, $this->controller->execute()); } + /** + * Test execute model exception + * + * @return void + */ public function testExecuteModelException() { $message = 'model exception'; @@ -273,6 +288,11 @@ class AddCommentTest extends \PHPUnit_Framework_TestCase $this->assertSame($this->resultJsonMock, $this->controller->execute()); } + /** + * Test execute exception + * + *@return void + */ public function testExecuteException() { $response = ['error' => true, 'message' => 'Cannot add new comment.']; diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php index f16b28728cf12da657ca6e4e0bd88676caf7fb88..1c5cf1cefa0223c32ab910f86143b27b7be09ff9 100755 --- a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/Invoice/UpdateQtyTest.php @@ -70,6 +70,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase */ protected $resultJsonFactoryMock; + /** + * SetUp method + * + * @return void + */ public function setUp() { $objectManager = new ObjectManager($this); @@ -151,6 +156,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase ); } + /** + * Test execute + * + * @return void + */ public function testExecute() { $orderId = 1; @@ -247,6 +257,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase $this->assertSame($resultRaw, $this->controller->execute()); } + /** + * Test execute model exception + * + * @return void + */ public function testExecuteModelException() { $message = 'Cannot update item quantity.'; @@ -285,6 +300,11 @@ class UpdateQtyTest extends \PHPUnit_Framework_TestCase $this->assertSame($resultJsonMock, $this->controller->execute()); } + /** + * Test execute exception + * + * @return void + */ public function testExecuteException() { $message = 'Cannot update item quantity.'; diff --git a/app/code/Magento/Theme/Test/Unit/Model/PageLayout/Config/BuilderTest.php b/app/code/Magento/Theme/Test/Unit/Model/PageLayout/Config/BuilderTest.php index d81cdb4843b93eeb9c1f96cc834e542483b04f20..5d7df0ddef1b49bcff03747c1fbfafecfc904d5a 100755 --- a/app/code/Magento/Theme/Test/Unit/Model/PageLayout/Config/BuilderTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/PageLayout/Config/BuilderTest.php @@ -32,7 +32,9 @@ class BuilderTest extends \PHPUnit_Framework_TestCase protected $themeCollection; /** - * Setup + * SetUp method + * + * @return void */ protected function setUp() { @@ -66,6 +68,8 @@ class BuilderTest extends \PHPUnit_Framework_TestCase /** * Test get page layouts config + * + * @return void */ public function testGetPageLayoutsConfig() { diff --git a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/UpdateItemOptionsTest.php b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/UpdateItemOptionsTest.php index 6d23dc442cd40ae0c1a4d9e59610b74d21e26b16..9fddb7383a3034e51fcf973eb797f4638189083a 100755 --- a/app/code/Magento/Wishlist/Test/Unit/Controller/Index/UpdateItemOptionsTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Controller/Index/UpdateItemOptionsTest.php @@ -71,6 +71,11 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase */ protected $eventManager; + /** + * SetUp method + * + * @return void + */ protected function setUp() { $this->productRepository = $this->getMock('Magento\Catalog\Model\ProductRepository', [], [], '', false); @@ -87,6 +92,11 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase $this->eventManager = $this->getMock('Magento\Framework\Event\Manager', [], [], '', false); } + /** + * TearDown method + * + * @return void + */ public function tearDown() { unset( @@ -104,6 +114,11 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase ); } + /** + * Prepare context + * + * @return void + */ public function prepareContext() { $actionFlag = $this->getMock('Magento\Framework\App\ActionFlag', [], [], '', false); @@ -146,6 +161,11 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase ->willReturn($this->messageManager); } + /** + * Get controller + * + * @return \Magento\Wishlist\Controller\Index\UpdateItemOptions + */ protected function getController() { $this->prepareContext(); @@ -157,6 +177,11 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase ); } + /** + * Test execute without product id + * + * @return void + */ public function testExecuteWithoutProductId() { $this->request @@ -174,6 +199,11 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase $this->getController()->execute(); } + /** + * Test execute without product + * + * @return void + */ public function testExecuteWithoutProduct() { $this->request @@ -203,6 +233,11 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase $this->getController()->execute(); } + /** + * Test execute without wish list + * + * @return void + */ public function testExecuteWithoutWishList() { $product = $this->getMock('Magento\Catalog\Model\Product', [], [], '', false); @@ -269,6 +304,9 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase } /** + * Test execute add success exception + * + * @return void * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function testExecuteAddSuccessException() @@ -388,6 +426,9 @@ class UpdateItemOptionsTest extends \PHPUnit_Framework_TestCase $this->getController()->execute(); } /** + * Test execute add success critical exception + * + * @return void * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function testExecuteAddSuccessCriticalException() diff --git a/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php b/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php index 4976a670caafe8c40e7321bb5d9d522ba721e792..79a257b4ff77ceb505138f1cc486499c9ee06ca3 100755 --- a/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/PhraseTest.php @@ -20,7 +20,9 @@ class PhraseTest extends \PHPUnit_Framework_TestCase protected $rendererMock; /** - * Set up + * SetUp method + * + * @return void */ protected function setUp() { @@ -31,6 +33,8 @@ class PhraseTest extends \PHPUnit_Framework_TestCase /** * Tear down + * + * @return void */ protected function tearDown() { @@ -39,6 +43,8 @@ class PhraseTest extends \PHPUnit_Framework_TestCase /** * Test rendering + * + * @return void */ public function testRendering() { @@ -58,6 +64,8 @@ class PhraseTest extends \PHPUnit_Framework_TestCase /** * Test defers rendering + * + * @return void */ public function testDefersRendering() { @@ -69,6 +77,8 @@ class PhraseTest extends \PHPUnit_Framework_TestCase /** * Test that to string is alias to render + * + * @return void */ public function testThatToStringIsAliasToRender() { @@ -88,6 +98,8 @@ class PhraseTest extends \PHPUnit_Framework_TestCase /** * Test get text + * + * @return void */ public function testGetText() { @@ -99,6 +111,8 @@ class PhraseTest extends \PHPUnit_Framework_TestCase /** * Test get arguments + * + * @return void */ public function testGetArguments() {