Exemplo n.º 1
0
 public function test_createInt()
 {
     $this->assertCreateOfType(VarType::INT, 0, false, LiteSetup::createInt());
     $this->assertCreateOfType(VarType::INT, -123, false, LiteSetup::createInt(-123));
     $this->assertCreateOfType(VarType::INT, null, true, LiteSetup::createInt(null));
     $this->assertHasAccessRestriction(AccessRestriction::NO_GET, LiteSetup::createInt(null, AccessRestriction::NO_GET));
 }
Exemplo n.º 2
0
 public function test_fixValue_Scalars()
 {
     $this->assertSame(1.0, ValueValidation::fixValue(LiteSetup::createDouble(), "1"));
     $this->assertSame(23, ValueValidation::fixValue(LiteSetup::createInt(), "23"));
     $this->assertSame("1", ValueValidation::fixValue(LiteSetup::createString(), 1));
     $this->assertSame(false, ValueValidation::fixValue(LiteSetup::createBool(), []));
 }
Exemplo n.º 3
0
 /**
  * @return array
  */
 protected function _setup()
 {
     return ['DB' => LiteSetup::createString(), 'Host' => LiteSetup::createString('localhost'), 'Port' => LiteSetup::createInt(3306), 'User' => LiteSetup::createString(), 'Pass' => LiteSetup::createString(), 'PDOFlags' => LiteSetup::createArray()];
 }
Exemplo n.º 4
0
 /**
  * @return array
  */
 protected function _setup()
 {
     return ['PropInt' => LiteSetup::createInt(), 'PropString' => LiteSetup::createString('a'), 'PropArray' => LiteSetup::createArray([]), 'PropGetOnly' => LiteSetup::createInt(0, AccessRestriction::NO_SET), 'PropSetOnly' => LiteSetup::createInt(0, AccessRestriction::NO_GET), 'OnSetProperty' => LiteSetup::createInt()];
 }
Exemplo n.º 5
0
 /**
  * @return array
  */
 protected function _setup()
 {
     return ['FullPath' => LiteSetup::createString(), 'MD5' => LiteSetup::createString(''), 'FileSize' => LiteSetup::createInt(-1)];
 }