Exemplo n.º 1
0
 /**
  * Testing the version numbers of business objects.
  *
  * @since 1.0
  * @dataProvider getActiveRecordProviders
  */
 public function testGetVersion($provider)
 {
     $config = ConfigProvider::getInstance();
     $config->set('db.provider.name', $provider);
     $this->assertEquals(0, $this->person->getVersion(), 'Testing the version numbers of business objects');
     $this->assertEquals(0, $this->person->getVersionNumber()->getValue(), 'Testing the version numbers of business objects');
     $this->person->save();
     $this->assertEquals(1, $this->person->getVersion(), 'Testing the version numbers of business objects');
     $this->assertEquals(1, $this->person->getVersionNumber()->getValue(), 'Testing the version numbers of business objects');
     $this->person->save();
     $this->assertEquals(2, $this->person->getVersion(), 'Testing the version numbers of business objects');
     $this->assertEquals(2, $this->person->getVersionNumber()->getValue(), 'Testing the version numbers of business objects');
 }