assertEquals('', BSFunctions::$cssClass); BSFunctions::SwapCssClasses('1', '2'); $this->assertEquals('2', BSFunctions::$cssClass); BSFunctions::SwapCssClasses('1', '2'); $this->assertEquals('1', BSFunctions::$cssClass); BSFunctions::SwapCssClasses('1', '2'); $this->assertEquals('2', BSFunctions::$cssClass); } public function testFetchSourcePath() { $this->assertEquals('a' . DIRECTORY_SEPARATOR, BSFunctions::FetchSourcePath('a')); } public function testDownloadFile() { } public function testIsValidEmail() { $this->assertTrue(BSFunctions::IsValidEmail('test@example.com')); $this->assertTrue(BSFunctions::IsValidEmail('test@example.co.uk')); $this->assertTrue(BSFunctions::IsValidEmail('test.foo_hi@example.edu.k12.paloalto.ca.us')); $this->assertFalse(BSFunctions::IsValidEmail('')); $this->assertFalse(BSFunctions::IsValidEmail('te#st@example.com')); $this->assertFalse(BSFunctions::IsValidEmail('@example.com')); $this->assertFalse(BSFunctions::IsValidEmail('test@.com')); } public function testIsBrowser() { } public function testRandom() { $values = array(); for ($i = 0; $i < 100; $i++) { $random = BSFunctions::Random(5); $this->assertEquals(5, strlen($random)); $this->assertFalse(in_array($random, $values)); $values[] = $random; } } public function testArraySetCurrent() { $array = array('a', 'b', 'c', 'd'); $this->assertEquals('a', current($array)); $this->assertEquals('b', next($array)); $this->assertEquals('c', next($array)); BSFunctions::ArraySetCurrent($array, 0); $this->assertEquals('a', current($array)); BSFunctions::ArraySetCurrent($array, 3); $this->assertEquals('d', current($array)); } public function testFetchMicrotimeDiff() { } public function testFetchExtension() { $this->assertEquals('txt', BSFunctions::FetchExtension('test.txt')); $this->assertEquals('', BSFunctions::FetchExtension('test')); $this->assertEquals('xml', BSFunctions::FetchExtension('test.file.xml')); } public function testFetchMaxPhpFileSize() { } public function testScanDirectory() { } public function testConvertLineBreaks() { $string = "test\r\nstring\r\n"; $this->assertFalse(strpos("\r", BSFunctions::ConvertLineBreaks($string))); } public function testArrayStripEmpty() { $array = array(1, 4, 6); $this->assertEquals(3, sizeof(BSFunctions::ArrayStripEmpty($array))); $array = array(1, 0, 5, ''); $this->assertEquals(2, sizeof(BSFunctions::ArrayStripEmpty($array))); $array = array('', 'test' => array('', 6)); $array = BSFunctions::ArrayStripEmpty($array); $this->assertEquals(1, sizeof($array)); $this->assertEquals(1, sizeof($array['test'])); } } ?>