public function testOptionKeysAreSorted()
 {
     $directive = new JSLintDirective();
     $this->assertTrue($directive->addOption('evil', true));
     $this->assertTrue($directive->addOption('anon', true));
     $this->assertTrue($directive->addOption('nomen', true));
     $this->assertEquals(array('anon' => true, 'evil' => true, 'nomen' => true), $directive->getOptions());
 }
 public function testStringifyMixedOptions()
 {
     $directive = new JSLintDirective();
     $directive->addOption('maxlen', 12);
     $directive->addOption('fragment', true);
     $directive->addOption('indent', 77);
     $directive->addOption('nomen', false);
     $this->assertEquals('/*jslint fragment: true, indent: 77, maxlen: 12, nomen: false */', (string) $directive);
 }
 public function testMaxErrOptionDefaultsTo50()
 {
     $directive = new JSLintDirective();
     $directive->addOption('maxerr', -1);
     $this->assertTrue(is_int($directive->getOption('maxerr')));
     $this->assertEquals(50, $directive->getOption('maxerr'));
 }
 public function testHasOptionsIsCaseInsensitive()
 {
     $directive = new JSLintDirective();
     $directive->addOption('fragment', true);
     $this->assertTrue($directive->hasOption('fragment'));
     $this->assertTrue($directive->hasOption('FRAGMENT'));
     $this->assertTrue($directive->hasOption('fragment'));
 }