public function testRepositoryGetsDateFormat()
 {
     $company = new Company();
     $company->CompanyName = "GCD";
     $company->LastUpdatedDate = "2012-01-01 10:01:02";
     $company->save();
     $params = MySql::getPreviousParameters();
     $this->assertContains("2012-01-01 10:01:02", $params["LastUpdatedDate"]);
     $company->reload();
     $this->assertEquals("2012-01-01 10:01:02", $company->LastUpdatedDate->format("Y-m-d H:i:s"));
 }
Example #2
0
 public function testRepositoryGetsTimeFormat()
 {
     $company = new Company();
     $company->CompanyName = "GCD";
     $company->KnockOffTime = "17:01:02";
     $company->save();
     $params = MySql::getPreviousParameters();
     $this->assertContains("17:01:02", $params["KnockOffTime"]);
     $company->reload();
     $this->assertEquals("2000-01-01 17:01:02", $company->KnockOffTime->format("Y-m-d H:i:s"));
 }
 public function testValidJsonTransform()
 {
     $company = new Company();
     $company->CompanyName = "Gcd Technologies";
     $company->CompanyData = $this->data;
     $company->save();
     $params = MySql::getPreviousParameters();
     $this->assertEquals($this->constraint, $params["CompanyData"]);
     Model::clearAllRepositories();
     $company = new Company($company->UniqueIdentifier);
     $this->assertEquals($this->data, $company->CompanyData);
 }
Example #4
0
 public function testRepositoryGetsDateFormat()
 {
     $company = new Company();
     $company->CompanyName = "GCD";
     $company->InceptionDate = "2012-01-01";
     $company->save();
     $params = MySql::getPreviousParameters();
     $this->assertContains("2012-01-01", $params["InceptionDate"]);
     $company->reload();
     $this->assertEquals("2012-01-01", $company->InceptionDate->format("Y-m-d"));
     $company->InceptionDate = "2011-01-01";
     $company->save();
     $company->reload();
     $this->assertEquals("2011-01-01", $company->InceptionDate->format("Y-m-d"));
 }