protected function childAssertion() { $this->reloadBFoos(); $position = 1; foreach ($this->bfoos as $bfoo) { Assert::eq($position, $bfoo->getListifyPosition()); $position++; } }
public function testMakeWithExistClass() { //Arrange $mock = m::mock('Witooh\\Validator\\IBaseValidator'); //Act $validatorFactory = new ValidatorFactory($this->resolverContainer); $validatorClass = $validatorFactory->make(get_class($mock), array()); //Assert Assert::instance('Witooh\\Validator\\IBaseValidator', $validatorClass); }
protected function childAssertion() { $this->reloadFoos(); $this->reloadBFoos(); $position = 1; foreach ($this->foos as $foo) { Assert::eq($this->foreignKeyId, $foo->foo_with_belongsto_scope_b_id); $position++; } $position = 1; foreach ($this->bfoos as $bfoo) { Assert::eq($position, $bfoo->getListifyPosition()); $position++; } }
public function testResolveAndHas() { //Arrange $this->createApplication(); $a = m::mock('Illuminate\\Validation\\Validator'); $b = m::mock('Illuminate\\Validation\\Validator'); $resolvers = array(get_class($a), get_class($b)); //Act $resolverContainer = new ResolverContainer(); $resolverContainer->resolve($resolvers); //Assert Assert::assertTrue($resolverContainer->has(get_class($a))); Assert::assertTrue($resolverContainer->has(get_class($b))); Assert::assertFalse($resolverContainer->has('noClass')); }
public function test_addToListTop() { $foo = new $this->model(); $foo->name = $this->model . "New"; if ($this->belongsToFunction && $this->belongsToObject) { $btf = $this->belongsToFunction; $bto = $this->belongsToObject; $foo->{$btf}()->associate($bto); } $foo->setListifyConfig('add_new_at', 'top'); $foo->save(); Assert::eq(1, $foo->getListifyPosition()); }
/** * Tests whether `Breadcrumbs::removeAll()` works correctly. * * @dataProvider crumbsProvider */ public function testRemoveAll($crumbs) { $b = new Breadcrumbs($crumbs); $b->removeAll(); Assert::true($b->isEmpty()); }
public function testAdd() { Assert::equals(20, 20); Assert::greaterThan(20, 21); Should::equal('Test', 'Test'); }