public function testFillableAndGuardedAttributes()
 {
     $product = Factory::make('Giftertipster\\Entity\\Eloquent\\RangeCronJob');
     assertThat($product['guarded'], hasItemInArray('id'));
     assertThat($product['guarded'], hasItemInArray('created_at'));
     assertThat($product['guarded'], hasItemInArray('updated_at'));
     assertThat($product['fillable'], hasItemInArray('job_name'));
     assertThat($product['fillable'], hasItemInArray('last_id_processed'));
     assertThat($product['fillable'], hasItemInArray('last_status'));
 }
 public function testHasAReadableDescription()
 {
     $this->assertDescription('an array containing "a"', hasItemInArray('a'));
 }
 public function testUpdatedAtIsGuarded()
 {
     $product = Factory::make('Giftertipster\\Entity\\Eloquent\\Category\\SubInterestCategory');
     assertThat($product['guarded'], either(hasItemInArray('updated_at'))->orElse(hasItemInArray('*')));
 }
 public function testUpdatedAtIsGuarded()
 {
     $product = Factory::make('Giftertipster\\Entity\\Eloquent\\Analytic\\UserAnalytic', ['user_id' => 1]);
     assertThat($product['guarded'], either(hasItemInArray('updated_at'))->orElse(hasItemInArray('*')));
 }
 public function testImageableTypeIsGuarded()
 {
     $product = Factory::make('Giftertipster\\Entity\\Eloquent\\Image');
     assertThat($product['guarded'], either(hasItemInArray('imageable_type'))->orElse(hasItemInArray('*')));
 }
Esempio n. 6
0
 public function testFullMapWithCandidates()
 {
     $licenseMap = new LicenseMap($this->dbManager, $this->groupId, LicenseMap::CONCLUSION, true);
     $map = \Fossology\Lib\Test\Reflectory::getObjectsProperty($licenseMap, 'map');
     assertThat($map, hasItemInArray(array('rf_fk' => 1, 'parent_shortname' => 'One', 'rf_parent' => 1)));
     assertThat($map, hasItemInArray(array('rf_fk' => 2, 'parent_shortname' => 'One', 'rf_parent' => 1)));
     assertThat($map, hasItemInArray(array('rf_fk' => 3, 'parent_shortname' => 'Three', 'rf_parent' => 3)));
 }
 public function testUpdatedAtIsGuarded()
 {
     $add_type = Factory::make('Giftertipster\\Entity\\Eloquent\\AddType');
     assertThat($add_type['guarded'], either(hasItemInArray('updated_at'))->orElse(hasItemInArray('*')));
 }
 public function testUserIdIsFillable()
 {
     $product = Factory::make('Giftertipster\\Entity\\Eloquent\\ProductRequest');
     assertThat($product['fillable'], either(hasItemInArray('user_id'))->orElse(hasItemInArray('*')));
 }
 public function tesListingIsFillable()
 {
     $product = Factory::make('Giftertipster\\Entity\\Eloquent\\FeaturedListing');
     assertThat($product['fillable'], either(hasItemInArray('listing'))->orElse(hasItemInArray('*')));
 }
 public function testProductIdIsGuarded()
 {
     $product = Factory::make('Giftertipster\\Entity\\Eloquent\\KeywordProfile');
     assertThat($product['guarded'], either(hasItemInArray('product_id'))->orElse(hasItemInArray('*')));
 }
 public function testAddTypeIdIsFillable()
 {
     $add = Factory::make('Giftertipster\\Entity\\Eloquent\\Add');
     assertThat($add['fillable'], either(hasItemInArray('add_type_id'))->orElse(hasItemInArray('*')));
 }
 public function testVendorIdIsFillable()
 {
     $blacklisted_product = Factory::make('Giftertipster\\Entity\\Eloquent\\BlacklistedProduct');
     assertThat($blacklisted_product['fillable'], either(hasItemInArray('vendor_id'))->orElse(hasItemInArray('*')));
 }
 public function testProductIdIsFillable()
 {
     $product_delete_request = Factory::make('Giftertipster\\Entity\\Eloquent\\ProductDeleteRequest');
     assertThat($product_delete_request['fillable'], either(hasItemInArray('product_id'))->orElse(hasItemInArray('*')));
 }