Exemple #1
0
 public function testSkippedGroups()
 {
     $context = new Context();
     $this->assertFalse($context->hasSkippedGroups());
     $this->assertSame([], $context->getSkippedGroups());
     $this->assertNull($context->get(Context::SKIPPED_GROUPS));
     $context->skipGroup('test');
     $this->assertTrue($context->hasSkippedGroups());
     $this->assertEquals(['test'], $context->getSkippedGroups());
     $this->assertEquals(['test'], $context->get(Context::SKIPPED_GROUPS));
     $context->skipGroup('test1');
     $this->assertTrue($context->hasSkippedGroups());
     $this->assertEquals(['test', 'test1'], $context->getSkippedGroups());
     $this->assertEquals(['test', 'test1'], $context->get(Context::SKIPPED_GROUPS));
     $context->skipGroup('test');
     $this->assertTrue($context->hasSkippedGroups());
     $this->assertEquals(['test', 'test1'], $context->getSkippedGroups());
     $this->assertEquals(['test', 'test1'], $context->get(Context::SKIPPED_GROUPS));
     $context->undoGroupSkipping('test');
     $this->assertTrue($context->hasSkippedGroups());
     $this->assertEquals(['test1'], $context->getSkippedGroups());
     $this->assertEquals(['test1'], $context->get(Context::SKIPPED_GROUPS));
     $context->undoGroupSkipping('test1');
     $this->assertFalse($context->hasSkippedGroups());
     $this->assertSame([], $context->getSkippedGroups());
     $this->assertNull($context->get(Context::SKIPPED_GROUPS));
 }