#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 62.109.13.187 / Your IP : 216.73.216.11 [ Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28 System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : mosrembit ( 6064) PHP Version : 8.2.28 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/phpMyAdmin/test/classes/ |
Upload File : |
<?php
/**
* Tests for Types.class.php
*
* @package PhpMyAdmin-test
*/
/*
* Include to test.
*/
require_once 'libraries/Types.class.php';
/**
* Test class for PMA_Types.
*
* @package PhpMyAdmin-test
*/
class PMA_TypesTest extends PHPUnit_Framework_TestCase
{
/**
* @var PMA_Types
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
$this->object = new PMA_Types();
}
/**
* Test for isUnaryOperator
*
* @return void
*/
public function testUnary()
{
$this->assertTrue($this->object->isUnaryOperator('IS NULL'));
$this->assertFalse($this->object->isUnaryOperator('='));
}
/**
* Test for getUnaryOperators
*
* @return void
*/
public function testGetUnaryOperators()
{
$this->assertEquals(
array(
'IS NULL',
'IS NOT NULL',
"= ''",
"!= ''",
),
$this->object->getUnaryOperators()
);
}
/**
* Test for getNullOperators
*
* @return void
*/
public function testGetNullOperators()
{
$this->assertEquals(
array(
'IS NULL',
'IS NOT NULL',
),
$this->object->getNullOperators()
);
}
/**
* Test for getEnumOperators
*
* @return void
*/
public function testGetEnumOperators()
{
$this->assertEquals(
array(
'=',
'!=',
),
$this->object->getEnumOperators()
);
}
/**
* Test for getTextOperators
*
* @return void
*/
public function testgetTextOperators()
{
$this->assertEquals(
array(
'LIKE',
'LIKE %...%',
'NOT LIKE',
'=',
'!=',
'REGEXP',
'REGEXP ^...$',
'NOT REGEXP',
"= ''",
"!= ''",
'IN (...)',
'NOT IN (...)',
'BETWEEN',
'NOT BETWEEN',
),
$this->object->getTextOperators()
);
}
/**
* Test for getNumberOperators
*
* @return void
*/
public function testGetNumberOperators()
{
$this->assertEquals(
array(
'=',
'>',
'>=',
'<',
'<=',
'!=',
'LIKE',
'LIKE %...%',
'NOT LIKE',
'IN (...)',
'NOT IN (...)',
'BETWEEN',
'NOT BETWEEN',
),
$this->object->getNumberOperators()
);
}
/**
* Test for getting type operators
*
* @param string $type Type of field
* @param boolean $null Whether field can be NULL
* @param string $output Expected output
*
* @return void
*
* @dataProvider providerForGetTypeOperators
*/
public function testGetTypeOperators($type, $null, $output)
{
$this->assertEquals(
$output,
$this->object->getTypeOperators($type, $null)
);
}
/**
* data provider for testGetTypeOperators
*
* @return data for testGetTypeOperators
*/
public function providerForGetTypeOperators()
{
return array(
array(
'enum',
false,
array(
'=',
'!=',
)
),
array(
'CHAR',
true,
array(
'=',
'>',
'>=',
'<',
'<=',
'!=',
'LIKE',
'LIKE %...%',
'NOT LIKE',
'IN (...)',
'NOT IN (...)',
'BETWEEN',
'NOT BETWEEN',
'IS NULL',
'IS NOT NULL',
),
array(
'int',
false,
array(
'=',
'!=',
)
),
)
);
}
/**
* Test for getTypeOperatorsHtml
*
* @param string $type Type of field
* @param boolean $null Whether field can be NULL
* @param string $selectedOperator Option to be selected
* @param string $output Expected output
*
* @return void
*
* @dataProvider providerForTestGetTypeOperatorsHtml
*/
public function testGetTypeOperatorsHtml(
$type, $null, $selectedOperator, $output
) {
$this->assertEquals(
$output,
$this->object->getTypeOperatorsHtml($type, $null, $selectedOperator)
);
}
/**
* Provider for testGetTypeOperatorsHtml
*
* @return test data for getTypeOperatorsHtml
*/
public function providerForTestGetTypeOperatorsHtml()
{
return array(
array(
'enum',
false,
'=',
'<option value="=" selected="selected">=</option>'
. '<option value="!=">!=</option>'
)
);
}
/**
* Test for getTypeDescription
*
* @return void
*/
public function testGetTypeDescription()
{
$this->assertEquals(
'',
$this->object->getTypeDescription('enum')
);
}
/**
* Test for getFunctionsClass
*
* @return void
*/
public function testGetFunctionsClass()
{
$this->assertEquals(
array(),
$this->object->getFunctionsClass('enum')
);
}
/**
* Test for getFunctions
*
* @return void
*/
public function testGetFunctions()
{
$this->assertEquals(
array(),
$this->object->getFunctions('enum')
);
}
/**
* Test for getAllFunctions
*
* @return void
*/
public function testGetAllFunctions()
{
$this->assertEquals(
array(),
$this->object->getAllFunctions()
);
}
/**
* Test for getAttributes
*
* @return void
*/
public function testGetAttributes()
{
$this->assertEquals(
array(),
$this->object->getAttributes()
);
}
/**
* Test for getColumns
*
* @return void
*/
public function testGetColumns()
{
$this->assertEquals(
array(
'INT',
'VARCHAR',
'TEXT',
'DATE',
),
$this->object->getColumns()
);
}
}
?>