<?php/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    Samuel Blume <sam at blueshoes dot org>
* @author    Andrej Arn <andrej at blueshoes dot org>
*/?><?php
require_once($APP['path']['core'] . 'util/Bs_String.class.php');class Bs_String_PhpUnit extends Bs_TestCase {var $_Bs_String;function Bs_String_PhpUnit($name) {$this->Bs_TestCase($name);$this->_Bs_String =& new Bs_String;}
function __Bs_String_insert() {$expected = 'hllo'; $actual   = 'hello';$this->_Bs_String->insert($expected, 'e', 1);$this->assertEquals($expected, $actual, "");$expected = 'hllo'; $actual   = 'hllo';$this->_Bs_String->insert($expected, '', 1);$this->assertEquals($expected, $actual, "");$expected = 'hllo'; $actual   = 'hllo';$this->_Bs_String->insert($expected, false, 1);$this->assertEquals($expected, $actual, "");$expected = 'hllo'; $actual   = 'hllo';$this->_Bs_String->insert($expected, null, 1);$this->assertEquals($expected, $actual, "");$expected = 'foo '; $actual   = 'foo bar';$this->_Bs_String->insert($expected, 'bar', 4);$this->assertEquals($expected, $actual, "");}
function __Bs_String_escapeForRegexp() {$expected = 'hello';$actual = $this->_Bs_String->escapeForRegexp('hello');$this->assertEquals($expected, $actual, "");$expected = 'he\.ll\^o';$actual = $this->_Bs_String->escapeForRegexp('he.ll^o');$this->assertEquals($expected, $actual, "");$expected = '\^\.\[\$\(\)\|\*\+\?\{\\\\';$actual = $this->_Bs_String->escapeForRegexp('^.[$()|*+?{\\');$this->assertEquals($expected, $actual, "");}
function __Bs_String_removeFromToInt() {$expected = 'heorld';$actual = $this->_Bs_String->removeFromToInt('hello world', 2, 6);$this->assertEquals($expected, $actual, "'hello world', 2, 6");$expected = '';$actual = $this->_Bs_String->removeFromToInt('hello world', 0, 30);$this->assertEquals($expected, $actual, "'hello world', 0, 30");$expected = '';$actual = $this->_Bs_String->removeFromToInt('', 0, 30);$this->assertEquals($expected, $actual, "'', 0, 30");}
function __Bs_String_strrpos() {$expected = 16;$actual = $this->_Bs_String->strrpos('abc <b>bold</b> abc', 'abc');$this->assertEquals($expected, $actual, "");$expected = 0;$actual = $this->_Bs_String->strrpos('abc <b>bold</b> abc', 'abc', 5);$this->assertEquals($expected, $actual, "");}
function __Bs_String_ucWords() {$expected = 'Hello World';$actual = $this->_Bs_String->ucWords('hello world');$this->assertEquals($expected, $actual, "");$expected = 'Hello-world';$actual = $this->_Bs_String->ucWords('hello-world');$this->assertEquals($expected, $actual, "");$expected = 'Hello World';$actual = $this->_Bs_String->ucWords('hello world', array('-'));$this->assertEquals($expected, $actual, "");$expected = 'Hello-World';$actual = $this->_Bs_String->ucWords('hello-world', array('-'));$this->assertEquals($expected, $actual, "");}
function __Bs_String_lcFirst() {$expected = 'fOO';$actual = $this->_Bs_String->lcFirst($param='FOO');$this->assertEquals($expected, $actual, 'test 1, param: ' . $param);$expected = 'foo';$actual = $this->_Bs_String->lcFirst($param='foo');$this->assertEquals($expected, $actual, 'test 2, param: ' . $param);}
function __Bs_String_studlyCapsToSeparated() {$expected = 'Db Abstraction Layer';$actual = $this->_Bs_String->studlyCapsToSeparated($param='dbAbstractionLayer');$this->assertEquals($expected, $actual, 'test 1, param: ' . $param);$expected = 'Db Abstraction Layer';$actual = $this->_Bs_String->studlyCapsToSeparated($param='DbAbstractionLayer');$this->assertEquals($expected, $actual, 'test 2, param: ' . $param);$expected = 'DB Abstraction Layer';$actual = $this->_Bs_String->studlyCapsToSeparated($param='DBAbstractionLayer');$this->assertEquals($expected, $actual, 'test 3, param: ' . $param);$expected = 'Foo Bar 345';$actual = $this->_Bs_String->studlyCapsToSeparated($param='fooBar345');$this->assertEquals($expected, $actual, 'test 4, param: ' . $param);$expected = 'Foo 345 Bar';$actual = $this->_Bs_String->studlyCapsToSeparated($param='foo345Bar');$this->assertEquals($expected, $actual, 'test 5, param: ' . $param);$expected = 'Foo 345 Bar';$actual = $this->_Bs_String->studlyCapsToSeparated($param='foo345bar');$this->assertEquals($expected, $actual, 'test 6, param: ' . $param);$expected = 'Some DB';$actual = $this->_Bs_String->studlyCapsToSeparated($param='someDB');$this->assertEquals($expected, $actual, 'test 7, param: ' . $param);$expected = 'Some DB Layer';$actual = $this->_Bs_String->studlyCapsToSeparated($param='someDBLayer');$this->assertEquals($expected, $actual, 'test 7, param: ' . $param);}
}
?>