コード例 #1
0
 protected function childAssertion()
 {
     $this->reloadBFoos();
     $position = 1;
     foreach ($this->bfoos as $bfoo) {
         Assert::eq($position, $bfoo->getListifyPosition());
         $position++;
     }
 }
コード例 #2
0
ファイル: ValidatorFactoryTest.php プロジェクト: witooh/neo4j
 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);
 }
コード例 #3
0
 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++;
     }
 }
コード例 #4
0
 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'));
 }
コード例 #5
0
 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());
 }
コード例 #6
0
 /**
  * Tests whether `Breadcrumbs::removeAll()` works correctly.
  *
  * @dataProvider crumbsProvider
  */
 public function testRemoveAll($crumbs)
 {
     $b = new Breadcrumbs($crumbs);
     $b->removeAll();
     Assert::true($b->isEmpty());
 }
コード例 #7
0
ファイル: SampleTest.php プロジェクト: n-kurasawa/test-sample
 public function testAdd()
 {
     Assert::equals(20, 20);
     Assert::greaterThan(20, 21);
     Should::equal('Test', 'Test');
 }