mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge branch 'master' into 2.6
This commit is contained in:
commit
af43bc1706
6 changed files with 96 additions and 56 deletions
|
@ -249,6 +249,7 @@ class Postgres extends DboSource {
|
|||
}
|
||||
if (
|
||||
$fields[$c->name]['default'] === 'NULL' ||
|
||||
$c->default === null ||
|
||||
preg_match('/nextval\([\'"]?([\w.]+)/', $c->default, $seq)
|
||||
) {
|
||||
$fields[$c->name]['default'] = null;
|
||||
|
|
|
@ -65,6 +65,13 @@ class CakeEmail {
|
|||
*/
|
||||
const MESSAGE_TEXT = 'text';
|
||||
|
||||
/**
|
||||
* Holds the regex pattern for email validation
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const EMAIL_PATTERN = '/^((?:[\p{L}0-9.!#$%&\'*+\/=?^_`{|}~-]+)*@[\p{L}0-9-.]+)$/ui';
|
||||
|
||||
/**
|
||||
* Recipient of the email
|
||||
*
|
||||
|
@ -320,7 +327,7 @@ class CakeEmail {
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_emailPattern = '/^((?:[\p{L}0-9.!#$%&\'*+\/=?^_`{|}~-]+)*@[\p{L}0-9-.]+)$/ui';
|
||||
protected $_emailPattern = self::EMAIL_PATTERN;
|
||||
|
||||
/**
|
||||
* The class name used for email configuration.
|
||||
|
@ -1291,7 +1298,7 @@ class CakeEmail {
|
|||
$this->headerCharset = null;
|
||||
$this->_attachments = array();
|
||||
$this->_config = array();
|
||||
$this->_emailPattern = null;
|
||||
$this->_emailPattern = self::EMAIL_PATTERN;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1099,6 +1099,26 @@ class PostgresTest extends CakeTestCase {
|
|||
$this->assertNotContains($scientificNotation, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that postgres describes UUID columns correctly.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDescribeUuid() {
|
||||
$db = $this->Dbo;
|
||||
$db->execute('CREATE TABLE test_uuid_describe (id UUID PRIMARY KEY, name VARCHAR(255))');
|
||||
$data = $db->describe('test_uuid_describe');
|
||||
|
||||
$expected = array(
|
||||
'type' => 'string',
|
||||
'null' => false,
|
||||
'default' => null,
|
||||
'length' => 36,
|
||||
);
|
||||
$this->assertSame($expected, $data['id']);
|
||||
$db->execute('DROP TABLE test_uuid_describe');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test describe() behavior for timestamp columns.
|
||||
*
|
||||
|
|
|
@ -168,21 +168,21 @@ class CakeEmailTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testFrom() {
|
||||
$this->assertSame($this->CakeEmail->from(), array());
|
||||
$this->assertSame(array(), $this->CakeEmail->from());
|
||||
|
||||
$this->CakeEmail->from('cake@cakephp.org');
|
||||
$expected = array('cake@cakephp.org' => 'cake@cakephp.org');
|
||||
$this->assertSame($this->CakeEmail->from(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->from());
|
||||
|
||||
$this->CakeEmail->from(array('cake@cakephp.org'));
|
||||
$this->assertSame($this->CakeEmail->from(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->from());
|
||||
|
||||
$this->CakeEmail->from('cake@cakephp.org', 'CakePHP');
|
||||
$expected = array('cake@cakephp.org' => 'CakePHP');
|
||||
$this->assertSame($this->CakeEmail->from(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->from());
|
||||
|
||||
$result = $this->CakeEmail->from(array('cake@cakephp.org' => 'CakePHP'));
|
||||
$this->assertSame($this->CakeEmail->from(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->from());
|
||||
$this->assertSame($this->CakeEmail, $result);
|
||||
|
||||
$this->setExpectedException('SocketException');
|
||||
|
@ -215,20 +215,20 @@ class CakeEmailTest extends CakeTestCase {
|
|||
*/
|
||||
public function testSender() {
|
||||
$this->CakeEmail->reset();
|
||||
$this->assertSame($this->CakeEmail->sender(), array());
|
||||
$this->assertSame(array(), $this->CakeEmail->sender());
|
||||
|
||||
$this->CakeEmail->sender('cake@cakephp.org', 'Name');
|
||||
$expected = array('cake@cakephp.org' => 'Name');
|
||||
$this->assertSame($this->CakeEmail->sender(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->sender());
|
||||
|
||||
$headers = $this->CakeEmail->getHeaders(array('from' => true, 'sender' => true));
|
||||
$this->assertFalse($headers['From']);
|
||||
$this->assertSame($headers['Sender'], 'Name <cake@cakephp.org>');
|
||||
$this->assertSame('Name <cake@cakephp.org>', $headers['Sender']);
|
||||
|
||||
$this->CakeEmail->from('cake@cakephp.org', 'CakePHP');
|
||||
$headers = $this->CakeEmail->getHeaders(array('from' => true, 'sender' => true));
|
||||
$this->assertSame($headers['From'], 'CakePHP <cake@cakephp.org>');
|
||||
$this->assertSame($headers['Sender'], '');
|
||||
$this->assertSame('CakePHP <cake@cakephp.org>', $headers['From']);
|
||||
$this->assertSame('', $headers['Sender']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -237,16 +237,16 @@ class CakeEmailTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testTo() {
|
||||
$this->assertSame($this->CakeEmail->to(), array());
|
||||
$this->assertSame(array(), $this->CakeEmail->to());
|
||||
|
||||
$result = $this->CakeEmail->to('cake@cakephp.org');
|
||||
$expected = array('cake@cakephp.org' => 'cake@cakephp.org');
|
||||
$this->assertSame($this->CakeEmail->to(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->to());
|
||||
$this->assertSame($this->CakeEmail, $result);
|
||||
|
||||
$this->CakeEmail->to('cake@cakephp.org', 'CakePHP');
|
||||
$expected = array('cake@cakephp.org' => 'CakePHP');
|
||||
$this->assertSame($this->CakeEmail->to(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->to());
|
||||
|
||||
$list = array(
|
||||
'root@localhost' => 'root',
|
||||
|
@ -263,7 +263,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'cake-php@googlegroups.com' => 'Cake Groups',
|
||||
'root@cakephp.org' => 'root@cakephp.org'
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->to(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->to());
|
||||
|
||||
$this->CakeEmail->addTo('jrbasso@cakephp.org');
|
||||
$this->CakeEmail->addTo('mark_story@cakephp.org', 'Mark Story');
|
||||
|
@ -281,7 +281,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'phpnut@cakephp.org' => 'PhpNut',
|
||||
'jose_zap@cakephp.org' => 'jose_zap@cakephp.org'
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->to(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->to());
|
||||
$this->assertSame($this->CakeEmail, $result);
|
||||
}
|
||||
|
||||
|
@ -501,10 +501,10 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$result = $this->CakeEmail->messageId('<my-email@localhost>');
|
||||
$this->assertSame($this->CakeEmail, $result);
|
||||
$result = $this->CakeEmail->getHeaders();
|
||||
$this->assertSame($result['Message-ID'], '<my-email@localhost>');
|
||||
$this->assertSame('<my-email@localhost>', $result['Message-ID']);
|
||||
|
||||
$result = $this->CakeEmail->messageId();
|
||||
$this->assertSame($result, '<my-email@localhost>');
|
||||
$this->assertSame('<my-email@localhost>', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -560,16 +560,16 @@ class CakeEmailTest extends CakeTestCase {
|
|||
*/
|
||||
public function testSubject() {
|
||||
$this->CakeEmail->subject('You have a new message.');
|
||||
$this->assertSame($this->CakeEmail->subject(), 'You have a new message.');
|
||||
$this->assertSame('You have a new message.', $this->CakeEmail->subject());
|
||||
|
||||
$this->CakeEmail->subject('You have a new message, I think.');
|
||||
$this->assertSame($this->CakeEmail->subject(), 'You have a new message, I think.');
|
||||
$this->CakeEmail->subject(1);
|
||||
$this->assertSame($this->CakeEmail->subject(), '1');
|
||||
$this->assertSame('1', $this->CakeEmail->subject());
|
||||
|
||||
$this->CakeEmail->subject('هذه رسالة بعنوان طويل مرسل للمستلم');
|
||||
$expected = '=?UTF-8?B?2YfYsNmHINix2LPYp9mE2Kkg2KjYudmG2YjYp9mGINi32YjZitmEINmF2LE=?=' . "\r\n" . ' =?UTF-8?B?2LPZhCDZhNmE2YXYs9iq2YTZhQ==?=';
|
||||
$this->assertSame($this->CakeEmail->subject(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->subject());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -584,13 +584,13 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->headerCharset = 'ISO-2022-JP';
|
||||
$this->CakeEmail->subject('日本語のSubjectにも対応するよ');
|
||||
$expected = '=?ISO-2022-JP?B?GyRCRnxLXDhsJE4bKEJTdWJqZWN0GyRCJEskYkJQMX4kOSRrJGgbKEI=?=';
|
||||
$this->assertSame($this->CakeEmail->subject(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->subject());
|
||||
|
||||
$this->CakeEmail->subject('長い長い長いSubjectの場合はfoldingするのが正しいんだけどいったいどうなるんだろう?');
|
||||
$expected = "=?ISO-2022-JP?B?GyRCRDkkJEQ5JCREOSQkGyhCU3ViamVjdBskQiROPmw5ZyRPGyhCZm9s?=\r\n" .
|
||||
" =?ISO-2022-JP?B?ZGluZxskQiQ5JGskTiQsQDUkNyQkJHMkQCQxJEkkJCRDJD8kJCRJGyhC?=\r\n" .
|
||||
" =?ISO-2022-JP?B?GyRCJCYkSiRrJHMkQCRtJCYhKRsoQg==?=";
|
||||
$this->assertSame($this->CakeEmail->subject(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->subject());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -609,7 +609,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'Content-Type' => 'text/plain; charset=UTF-8',
|
||||
'Content-Transfer-Encoding' => '8bit'
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->getHeaders(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->getHeaders());
|
||||
|
||||
$this->CakeEmail->addHeaders(array('X-Something' => 'very nice', 'X-Other' => 'cool'));
|
||||
$expected = array(
|
||||
|
@ -621,10 +621,10 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'Content-Type' => 'text/plain; charset=UTF-8',
|
||||
'Content-Transfer-Encoding' => '8bit'
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->getHeaders(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->getHeaders());
|
||||
|
||||
$this->CakeEmail->from('cake@cakephp.org');
|
||||
$this->assertSame($this->CakeEmail->getHeaders(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->getHeaders());
|
||||
|
||||
$expected = array(
|
||||
'From' => 'cake@cakephp.org',
|
||||
|
@ -636,11 +636,11 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'Content-Type' => 'text/plain; charset=UTF-8',
|
||||
'Content-Transfer-Encoding' => '8bit'
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->getHeaders(array('from' => true)), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->getHeaders(array('from' => true)));
|
||||
|
||||
$this->CakeEmail->from('cake@cakephp.org', 'CakePHP');
|
||||
$expected['From'] = 'CakePHP <cake@cakephp.org>';
|
||||
$this->assertSame($this->CakeEmail->getHeaders(array('from' => true)), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->getHeaders(array('from' => true)));
|
||||
|
||||
$this->CakeEmail->to(array('cake@cakephp.org', 'php@cakephp.org' => 'CakePHP'));
|
||||
$expected = array(
|
||||
|
@ -654,7 +654,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'Content-Type' => 'text/plain; charset=UTF-8',
|
||||
'Content-Transfer-Encoding' => '8bit'
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->getHeaders(array('from' => true, 'to' => true)), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->getHeaders(array('from' => true, 'to' => true)));
|
||||
|
||||
$this->CakeEmail->charset = 'ISO-2022-JP';
|
||||
$expected = array(
|
||||
|
@ -668,7 +668,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'Content-Type' => 'text/plain; charset=ISO-2022-JP',
|
||||
'Content-Transfer-Encoding' => '7bit'
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->getHeaders(array('from' => true, 'to' => true)), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->getHeaders(array('from' => true, 'to' => true)));
|
||||
|
||||
$result = $this->CakeEmail->setHeaders(array());
|
||||
$this->assertInstanceOf('CakeEmail', $result);
|
||||
|
@ -719,19 +719,19 @@ class CakeEmailTest extends CakeTestCase {
|
|||
public function testTemplate() {
|
||||
$this->CakeEmail->template('template', 'layout');
|
||||
$expected = array('template' => 'template', 'layout' => 'layout');
|
||||
$this->assertSame($this->CakeEmail->template(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->template());
|
||||
|
||||
$this->CakeEmail->template('new_template');
|
||||
$expected = array('template' => 'new_template', 'layout' => 'layout');
|
||||
$this->assertSame($this->CakeEmail->template(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->template());
|
||||
|
||||
$this->CakeEmail->template('template', null);
|
||||
$expected = array('template' => 'template', 'layout' => null);
|
||||
$this->assertSame($this->CakeEmail->template(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->template());
|
||||
|
||||
$this->CakeEmail->template(null, null);
|
||||
$expected = array('template' => null, 'layout' => null);
|
||||
$this->assertSame($this->CakeEmail->template(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->template());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -740,7 +740,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testTheme() {
|
||||
$this->assertSame(null, $this->CakeEmail->theme());
|
||||
$this->assertNull($this->CakeEmail->theme());
|
||||
|
||||
$this->CakeEmail->theme('default');
|
||||
$expected = 'default';
|
||||
|
@ -753,16 +753,16 @@ class CakeEmailTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testViewVars() {
|
||||
$this->assertSame($this->CakeEmail->viewVars(), array());
|
||||
$this->assertSame(array(), $this->CakeEmail->viewVars());
|
||||
|
||||
$this->CakeEmail->viewVars(array('value' => 12345));
|
||||
$this->assertSame($this->CakeEmail->viewVars(), array('value' => 12345));
|
||||
$this->assertSame(array('value' => 12345), $this->CakeEmail->viewVars());
|
||||
|
||||
$this->CakeEmail->viewVars(array('name' => 'CakePHP'));
|
||||
$this->assertSame($this->CakeEmail->viewVars(), array('value' => 12345, 'name' => 'CakePHP'));
|
||||
$this->assertSame(array('value' => 12345, 'name' => 'CakePHP'), $this->CakeEmail->viewVars());
|
||||
|
||||
$this->CakeEmail->viewVars(array('value' => 4567));
|
||||
$this->assertSame($this->CakeEmail->viewVars(), array('value' => 4567, 'name' => 'CakePHP'));
|
||||
$this->assertSame(array('value' => 4567, 'name' => 'CakePHP'), $this->CakeEmail->viewVars());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -778,10 +778,10 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'mimetype' => 'application/octet-stream'
|
||||
)
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->attachments(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->attachments());
|
||||
|
||||
$this->CakeEmail->attachments(array());
|
||||
$this->assertSame($this->CakeEmail->attachments(), array());
|
||||
$this->assertSame(array(), $this->CakeEmail->attachments());
|
||||
|
||||
$this->CakeEmail->attachments(array(
|
||||
array('file' => CAKE . 'basics.php', 'mimetype' => 'text/plain')
|
||||
|
@ -795,7 +795,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
'other.txt' => array('file' => CAKE . 'bootstrap.php', 'mimetype' => 'application/octet-stream'),
|
||||
'license' => array('file' => CAKE . 'LICENSE.txt', 'mimetype' => 'application/octet-stream')
|
||||
);
|
||||
$this->assertSame($this->CakeEmail->attachments(), $expected);
|
||||
$this->assertSame($expected, $this->CakeEmail->attachments());
|
||||
|
||||
$this->setExpectedException('SocketException');
|
||||
$this->CakeEmail->attachments(array(array('nofile' => CAKE . 'basics.php', 'mimetype' => 'text/plain')));
|
||||
|
@ -809,7 +809,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
public function testTransport() {
|
||||
$result = $this->CakeEmail->transport('Debug');
|
||||
$this->assertSame($this->CakeEmail, $result);
|
||||
$this->assertSame($this->CakeEmail->transport(), 'Debug');
|
||||
$this->assertSame('Debug', $this->CakeEmail->transport());
|
||||
|
||||
$result = $this->CakeEmail->transportClass();
|
||||
$this->assertInstanceOf('DebugTransport', $result);
|
||||
|
@ -840,11 +840,11 @@ class CakeEmailTest extends CakeTestCase {
|
|||
|
||||
$config = array('test' => 'ok', 'test2' => true);
|
||||
$this->CakeEmail->config($config);
|
||||
$this->assertSame($transportClass->config(), $config);
|
||||
$this->assertSame($this->CakeEmail->config(), $config);
|
||||
$this->assertSame($config, $transportClass->config());
|
||||
$this->assertSame($config, $this->CakeEmail->config());
|
||||
|
||||
$this->CakeEmail->config(array());
|
||||
$this->assertSame($transportClass->config(), $config);
|
||||
$this->assertSame($config, $transportClass->config());
|
||||
|
||||
$config = array('test' => 'test@example.com');
|
||||
$this->CakeEmail->config($config);
|
||||
|
@ -959,7 +959,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
|
||||
$result = $this->CakeEmail->send("Other body");
|
||||
$expected = "Other body\r\n\r\n";
|
||||
$this->assertSame($result['message'], $expected);
|
||||
$this->assertSame($expected, $result['message']);
|
||||
$this->assertTrue((bool)strpos($result['headers'], 'Message-ID: '));
|
||||
$this->assertTrue((bool)strpos($result['headers'], 'To: '));
|
||||
|
||||
|
@ -971,7 +971,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->config(array('empty'));
|
||||
$result = $this->CakeEmail->send(array('Sending content', 'As array'));
|
||||
$expected = "Sending content\r\nAs array\r\n\r\n\r\n";
|
||||
$this->assertSame($result['message'], $expected);
|
||||
$this->assertSame($expected, $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1757,12 +1757,12 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->to('cake@cakephp.org');
|
||||
$this->CakeEmail->theme('TestTheme');
|
||||
$this->CakeEmail->emailPattern('/.+@.+\..+/i');
|
||||
$this->assertSame($this->CakeEmail->to(), array('cake@cakephp.org' => 'cake@cakephp.org'));
|
||||
$this->assertSame(array('cake@cakephp.org' => 'cake@cakephp.org'), $this->CakeEmail->to());
|
||||
|
||||
$this->CakeEmail->reset();
|
||||
$this->assertSame($this->CakeEmail->to(), array());
|
||||
$this->assertSame(null, $this->CakeEmail->theme());
|
||||
$this->assertSame(null, $this->CakeEmail->emailPattern());
|
||||
$this->assertSame(array(), $this->CakeEmail->to());
|
||||
$this->assertNull($this->CakeEmail->theme());
|
||||
$this->assertSame(CakeEmail::EMAIL_PATTERN, $this->CakeEmail->emailPattern());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1774,8 +1774,8 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->CakeEmail->charset = 'ISO-2022-JP';
|
||||
$this->CakeEmail->reset();
|
||||
|
||||
$this->assertSame($this->CakeEmail->charset, 'utf-8', $this->CakeEmail->charset);
|
||||
$this->assertSame($this->CakeEmail->headerCharset, null, $this->CakeEmail->headerCharset);
|
||||
$this->assertSame('utf-8', $this->CakeEmail->charset, $this->CakeEmail->charset);
|
||||
$this->assertNull($this->CakeEmail->headerCharset, $this->CakeEmail->headerCharset);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1498,6 +1498,18 @@ class HashTest extends CakeTestCase {
|
|||
)
|
||||
);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$array = array(
|
||||
0 => 'foo',
|
||||
1 => array(
|
||||
0 => 'baz'
|
||||
)
|
||||
);
|
||||
$expected = $array;
|
||||
$result = Hash::remove($array, '{n}.part');
|
||||
$this->assertEquals($expected, $result);
|
||||
$result = Hash::remove($array, '{n}.{n}.part');
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -365,7 +365,7 @@ class Hash {
|
|||
if (empty($data[$k])) {
|
||||
unset($data[$k]);
|
||||
}
|
||||
} elseif ($match) {
|
||||
} elseif ($match && empty($nextPath)) {
|
||||
unset($data[$k]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue