Example:
public function setDescription(string $description): SomeInterface;
to:
public function getDescription(): string;
php bin/magento config:set admin/security/session_lifetime 31536000 | |
php bin/magento config:set customer/captcha/enable 0 | |
php bin/magento config:set customer/password/password_reset_protection_type 0 |
<?php | |
$iterations = 1000000; | |
$arr = ['foo' => 'bar']; | |
function testIsset() | |
{ | |
global $iterations, $arr; |
/** | |
* @var OrderRepositoryInterface | |
*/ | |
protected $orderRepository; | |
/** | |
* @var \Magento\Sales\Model\Convert\Order | |
*/ | |
protected $convertOrder; |
This is a small collection of regular expressions to find pieces of code and replace them with PHPUnit mocks. It's useful for copy/pasting existing pieces of code (a constructor signature for example) and transforming them into usefull code for mocking in PHPUnit, without having to type everything out.
Disclaimer: some small code formatting might be required afterwards, but hey it's better than nothing ...
SET FOREIGN_KEY_CHECKS = 0; | |
TRUNCATE TABLE `gift_message`; | |
TRUNCATE TABLE `quote`; | |
TRUNCATE TABLE `quote_address`; | |
TRUNCATE TABLE `quote_address_item`; | |
TRUNCATE TABLE `quote_id_mask`; | |
TRUNCATE TABLE `quote_item`; | |
TRUNCATE TABLE `quote_item_option`; | |
TRUNCATE TABLE `quote_payment`; | |
TRUNCATE TABLE `quote_shipping_rate`; |
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Giel | |
* Date: 18/04/16 | |
* Time: 22:15 | |
*/ | |
namespace Gielberkers\Example\Plugin\Magento\Framework\Event; |
<?php | |
namespace Elephant\CFParent\Helper; | |
class ElephantData extends \Magento\Framework\App\Helper\AbstractHelper | |
{ | |
public function __construct( | |
\Magento\Framework\App\Helper\Context $context, | |
array $data = [] |
SET FOREIGN_KEY_CHECKS = 0; | |
TRUNCATE TABLE `catalog_category_entity`; | |
TRUNCATE TABLE `catalog_category_entity_datetime`; | |
TRUNCATE TABLE `catalog_category_entity_decimal`; | |
TRUNCATE TABLE `catalog_category_entity_int`; | |
TRUNCATE TABLE `catalog_category_entity_text`; | |
TRUNCATE TABLE `catalog_category_entity_varchar`; | |
TRUNCATE TABLE `catalog_category_product`; | |
TRUNCATE TABLE `catalog_category_product_index`; |
/* | |
Simple MapBox to show Google Maps | |
mapBox.setLatLng(0, 0); | |
mapBox.mapOptions.zoom = 16; | |
mapBox.addMarker(0, 0, { | |
url : '/images/marker.png', | |
anchorX : 15, | |
anchorY : 30, |