Skip to content
Snippets Groups Projects
Commit b9ea1315 authored by Dale Sikkema's avatar Dale Sikkema
Browse files

Merge branch 'MAGETWO-35833-backup-filter' into develop

parents 914f5767 f372d133
Branches
No related merge requests found
The Backup module allows administrators to perform backups and rollbacks. Types of backups include system, database and media backups. This module relies on the Cron module to schedule backups. The Backup module allows administrators to perform backups and rollbacks. Types of backups include system, database and media backups. This module relies on the Cron module to schedule backups.
This module does not effect the storefront. This module does not affect the storefront.
\ No newline at end of file
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
<arguments> <arguments>
<argument name="header" xsi:type="string" translate="true">Name</argument> <argument name="header" xsi:type="string" translate="true">Name</argument>
<argument name="index" xsi:type="string">display_name</argument> <argument name="index" xsi:type="string">display_name</argument>
<argument name="filter" xsi:type="string">0</argument>
<argument name="sortable" xsi:type="string">1</argument> <argument name="sortable" xsi:type="string">1</argument>
<argument name="column_css_class" xsi:type="string">col-name</argument> <argument name="column_css_class" xsi:type="string">col-name</argument>
<argument name="header_css_class" xsi:type="string">col-name</argument> <argument name="header_css_class" xsi:type="string">col-name</argument>
......
...@@ -696,7 +696,7 @@ class Filesystem extends \Magento\Framework\Data\Collection ...@@ -696,7 +696,7 @@ class Filesystem extends \Magento\Framework\Data\Collection
*/ */
public function filterCallbackLike($field, $filterValue, $row) public function filterCallbackLike($field, $filterValue, $row)
{ {
$filterValueRegex = str_replace('%', '(.*?)', preg_quote($filterValue, '/')); $filterValueRegex = str_replace('%', '(.*?)', str_replace('\'', '', preg_quote($filterValue, '/')));
return (bool)preg_match("/^{$filterValueRegex}\$/i", $row[$field]); return (bool)preg_match("/^{$filterValueRegex}\$/i", $row[$field]);
} }
......
<?php
/***
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Data\Test\Unit\Collection;
class FilesystemTest extends \PHPUnit_Framework_TestCase
{
/** @var \Magento\Framework\Data\Collection\Filesystem */
private $model;
public function setUp()
{
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$this->model = $objectManager->getObject('Magento\Framework\Data\Collection\Filesystem');
}
public function testFilterCallbackLike()
{
$field = 'field';
$row = [$field => 'beginning_filter_target_end',];
$filterValueSuccess = new \Zend_Db_Expr('%filter_target%');
$filterValueFailure = new \Zend_Db_Expr('%not_found_in_the_row%');
$this->assertTrue($this->model->filterCallbackLike($field, $filterValueSuccess, $row));
$this->assertFalse($this->model->filterCallbackLike($field, $filterValueFailure, $row));
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment