Ejemplo n.º 1
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(), []));
 }
Ejemplo n.º 2
0
 public function test_createBool()
 {
     $this->assertCreateOfType(VarType::BOOL, false, false, LiteSetup::createBool());
     $this->assertCreateOfType(VarType::BOOL, 12.23, false, LiteSetup::createBool(true));
     $this->assertCreateOfType(VarType::BOOL, null, true, LiteSetup::createBool(null));
     $this->assertHasAccessRestriction(AccessRestriction::NO_GET, LiteSetup::createBool(null, AccessRestriction::NO_GET));
 }
Ejemplo n.º 3
0
 /**
  * @return array
  */
 protected function _setup()
 {
     return ['IsAddTimestamp' => LiteSetup::createBool(false), 'TargetDirectory' => LiteSetup::createString('./'), 'StyleActions' => LiteSetup::createArray([], AccessRestriction::NO_SET), 'ScriptActions' => LiteSetup::createArray([], AccessRestriction::NO_SET)];
 }