Skip to content

Commit

Permalink
rename fun to func
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Sep 21, 2017
1 parent 250562b commit d6fe1e5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 2255 files
2 changes: 1 addition & 1 deletion lib/private/DB/QueryBuilder/QueryBuilder.php
Expand Up @@ -136,7 +136,7 @@ public function expr() {
*
* @return \OCP\DB\QueryBuilder\IFunctionBuilder
*/
public function fun() {
public function func() {
if ($this->connection instanceof OracleConnection) {
return new OCIFunctionBuilder($this->helper);
} else if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
Expand Down
2 changes: 1 addition & 1 deletion lib/public/DB/QueryBuilder/IQueryBuilder.php
Expand Up @@ -111,7 +111,7 @@ public function expr();
* @return \OCP\DB\QueryBuilder\IFunctionBuilder
* @since 12.0.0
*/
public function fun();
public function func();

/**
* Gets the type of the currently built query.
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
Expand Up @@ -43,31 +43,31 @@ protected function setUp() {
public function testConcat() {
$query = $this->connection->getQueryBuilder();

$query->select($query->fun()->concat($query->createNamedParameter('foo'), new Literal("'bar'")));
$query->select($query->func()->concat($query->createNamedParameter('foo'), new Literal("'bar'")));

$this->assertEquals('foobar', $query->execute()->fetchColumn());
}

public function testMd5() {
$query = $this->connection->getQueryBuilder();

$query->select($query->fun()->md5($query->createNamedParameter('foobar')));
$query->select($query->func()->md5($query->createNamedParameter('foobar')));

$this->assertEquals(md5('foobar'), $query->execute()->fetchColumn());
}

public function testSubstring() {
$query = $this->connection->getQueryBuilder();

$query->select($query->fun()->substring($query->createNamedParameter('foobar'), new Literal(2), $query->createNamedParameter(2)));
$query->select($query->func()->substring($query->createNamedParameter('foobar'), new Literal(2), $query->createNamedParameter(2)));

$this->assertEquals('oo', $query->execute()->fetchColumn());
}

public function testSubstringNoLength() {
$query = $this->connection->getQueryBuilder();

$query->select($query->fun()->substring($query->createNamedParameter('foobar'), new Literal(2)));
$query->select($query->func()->substring($query->createNamedParameter('foobar'), new Literal(2)));

$this->assertEquals('oobar', $query->execute()->fetchColumn());
}
Expand Down

0 comments on commit d6fe1e5

Please sign in to comment.