smiley 10 лет назад
Родитель
Сommit
7a85c2e0a8
2 измененных файлов с 28 добавлено и 0 удалено
  1. 1 0
      phpunit.xml
  2. 27 0
      tests/UtilTest.php

+ 1 - 0
phpunit.xml

@@ -18,6 +18,7 @@
     <testsuites>
         <testsuite name="php-qrcode test suite">
 			<file>tests/BitBufferTest.php</file>
+			<file>tests/UtilTest.php</file>
         </testsuite>
     </testsuites>
 </phpunit>

+ 27 - 0
tests/UtilTest.php

@@ -0,0 +1,27 @@
+<?php
+/**
+ * @filesource   UtilTest.php
+ * @created      08.02.2016
+ * @author       Smiley <smiley@chillerlan.net>
+ * @copyright    2015 Smiley
+ * @license      MIT
+ */
+
+use chillerlan\QRCode\Util;
+use chillerlan\QRCode\QRConst;
+
+class UtilTest extends PHPUnit_Framework_TestCase{
+
+	public function testIsNumber(){
+		$this->assertEquals(true, Util::isNumber('1234567890'));
+	}
+
+	public function testIsAlphaNum(){
+		$this->assertEquals(true, Util::isAlphaNum('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 $%*+-./:'));
+	}
+
+	public function testIsKanji(){
+		$this->assertEquals(true, Util::isKanji('茗荷'));
+	}
+
+}