Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify PHP unit construct #11674

Merged
merged 1 commit into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests-legacy/Integration/classes/MediaCoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testCorrectJQueryNoConflictURL()
{
$domain = Configuration::get('PS_SHOP_DOMAIN');
$result = Media::getJqueryPath('1.11');
$this->assertEquals(true, in_array('http://'.$domain.__PS_BASE_URI__.'js/jquery/jquery.noConflict.php?version=1.11', $result));
$this->assertTrue(in_array('http://'.$domain.__PS_BASE_URI__.'js/jquery/jquery.noConflict.php?version=1.11', $result));
}

protected function setUp()
Expand Down
8 changes: 4 additions & 4 deletions tests-legacy/Unit/Classes/ToolsCoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testGetValueBaseCase()
public function testGetValueDefaultValueIsFalse()
{
$this->setPostAndGet();
$this->assertEquals(false, Tools::getValue('hello'));
$this->assertFalse(Tools::getValue('hello'));
}

public function testGetValueUsesDefaultValue()
Expand All @@ -77,9 +77,9 @@ public function testGetValueAcceptsOnlyTruthyStringsAsKeys()
null => true
));

$this->assertEquals(false, Tools::getValue('', true));
$this->assertEquals(true, Tools::getValue(' '));
$this->assertEquals(false, Tools::getValue(null, true));
$this->assertFalse(Tools::getValue('', true));
$this->assertTrue(Tools::getValue(' '));
$this->assertFalse(Tools::getValue(null, true));
}

public function testGetValueStripsNullCharsFromReturnedStringsExamples()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ public function test_cannot_add_to_cart_from_listing_if_variants()
{
$this->product['id_product_attribute'] = 42;
$this->settings->allow_add_variant_to_cart_from_listing = false;
$this->assertEquals(
null,
$this->assertNull(
$this->getPresentedProductForListing('add_to_cart_url')
);
}
Expand All @@ -232,8 +231,7 @@ public function test_cannot_add_to_cart_from_listing_even_when_customized()
['is_customized' => true, 'required' => true]
]
];
$this->assertEquals(
null,
$this->assertNull(
$this->getPresentedProductForListing('add_to_cart_url')
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function testMultipleCartRulesWithoutCode()
}
$cartRule = $this->getCartRuleFromFixtureId(1);
$result = $cartRule->checkValidity(\Context::getContext(), false, false);
$this->assertEquals(true, $result);
$this->assertTrue($result);

$expectedTotal = (1 - $cartRulesData[14]['percent'] / 100)
* (1 - $cartRulesData[15]['percent'] / 100)
Expand Down
3 changes: 1 addition & 2 deletions tests-legacy/Unit/Core/Localization/CurrencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ protected function setUp()
*/
public function testIsActive()
{
$this->assertSame(
true,
$this->assertTrue(
$this->currency->isActive(),
'Wrong result for isActive()'
);
Expand Down