Пример #1
0
 /**
  * Test that invalid word gives us default color
  *
  * @since 0.1.1
  *
  * @covers \ingot\testing\utility\helpers::is_color_word()
  */
 public function testInvalidWordToHex()
 {
     $color = 'lemongrab';
     $this->assertSame(\ingot\testing\utility\defaults::color(), \ingot\testing\utility\helpers::prepare_color($color, false));
 }
Пример #2
0
 /**
  * Test default initial filter
  *
  * @since 0.1.1
  *
  * @covers \ingot\testing\utility\defaults::initial()
  * @covers ingot_default_initial
  */
 public function testInitialFilter()
 {
     add_filter('ingot_default_initial', function () {
         return 9;
     });
     $this->assertEquals(9, \ingot\testing\utility\defaults::initial());
 }
Пример #3
0
 /**
  * Calculate correct initial value
  *
  * @access protected
  *
  * @since 1.1.0
  *
  * @param \ingot\testing\object\group $group
  */
 protected function set_initial(\ingot\testing\object\group $group)
 {
     $average = sessions::get_instance()->get_average($this->use_unique($group->get_group_config()));
     if (!is_numeric($average) || 0 == $average || $average < defaults::threshold()) {
         $this->initial = defaults::initial();
     } else {
         $this->initial = $average;
     }
 }