<commit_before><?php

/**
 * SPHPlayground Framework (http://playgound.samiholck.com/)
 *
 * @link      https://github.com/samhol/SPHP-framework for the source repository
 * @copyright Copyright (c) 2007-2018 <NAME> <<EMAIL>>
 * @license   https://opensource.org/licenses/MIT The MIT License
 */

namespace Sphp\Tests\DateTime\Calendar\Diaries\Sports;

use PHPUnit\Framework\TestCase;
use Sphp\DateTime\Calendars\Diaries\Sports\TimedExercise;
use Sphp\DateTime\Duration;

class TimedExerciseTest extends TestCase {

  /**
   * @return TimedExercise
   */
  public function testConstructor(): TimedExercise {
    $exercise = new TimedExercise('foo', 'bar');
    $this->assertEquals('foo', $exercise->getName());
    $this->assertEquals('bar', $exercise->getDescription());
    return $exercise;
  }

  public function sets(): array {
    $sets[] = ['duration' => 'P1DT1M'];
    $sets[] = ['duration' => 'PT1M'];
    $sets[] = ['duration' => 'P1DT1M'];
    $sets[] = ['duration' => 'P1DT1M'];
    return $sets;
  }

  /**
   * @depends testConstructor
   * @param WeightLiftingExercise $exercise
   */
  public function testAddSet(TimedExercise $exercise): TimedExercise {
    $setData = $this->sets();
    $totalDuration = new Duration();
    foreach ($setData as $setValues) {
      $duration = Duration::from($setValues['duration']);
      $totalDuration->add($duration);
      $set = $exercise->addSet($setValues['duration']);
      $this->assertEquals($duration, $set->getDuration());
     // $this->assertEquals("{$weight}kg x $reps reps", "$set");
      $this->assertEquals(['duration' => "$duration"], $set->toArray());
      $this->assertEquals($totalDuration, $exercise->getTotalTime());
    }
    $this->assertCount(count($setData), $exercise);
    return $exercise;
  }

}
<commit_msg>Update TimedExerciseTest.php<commit_after><?php

/**
 * SPHPlayground Framework (http://playgound.samiholck.com/)
 *
 * @link      https://github.com/samhol/SPHP-framework for the source repository
 * @copyright Copyright (c) 2007-2018 <NAME> <<EMAIL>>
 * @license   https://opensource.org/licenses/MIT The MIT License
 */

namespace Sphp\Tests\DateTime\Calendar\Diaries\Sports;

use PHPUnit\Framework\TestCase;
use Sphp\DateTime\Calendars\Diaries\Sports\TimedExercise;
use Sphp\DateTime\Duration;

class TimedExerciseTest extends TestCase {

  /**
   * @return TimedExercise
   */
  public function testConstructor(): TimedExercise {
    $exercise = new TimedExercise('foo', 'bar');
    $this->assertEquals('foo', $exercise->getName());
    $this->assertEquals('bar', $exercise->getDescription());
    return $exercise;
  }

  public function sets(): array {
    $sets[] = ['duration' => 'P1DT1M'];
    $sets[] = ['duration' => 'PT1M'];
    $sets[] = ['duration' => 'P1DT1M'];
    $sets[] = ['duration' => 'P1DT1M'];
    return $sets;
  }

  /**
   * @depends testConstructor
   * @param WeightLiftingExercise $exercise
   */
  public function testAddSet(TimedExercise $exercise): TimedExercise {
    $setData = $this->sets();
    $totalDuration = new Duration();
    foreach ($setData as $setValues) {
      $duration = Duration::from($setValues['duration']);
      $totalDuration->add($duration);
      $set = $exercise->addSet($setValues['duration']);
      $this->assertEquals($duration, $set->getDuration());
     // $this->assertEquals("{$weight}kg x $reps reps", "$set");
      $this->assertEquals(['duration' => "$duration"], $set->toArray());
      $this->assertEquals($totalDuration, $exercise->getTotalTime());
    }
    $this->assertCount(count($setData), $exercise);
    return $exercise;
  }
  
  public function testTraversingSets() {
    
  }

}

{'fraction_non_alphanumeric': 0.17851284855112082, 'fraction_numerical': 0.008201202843083653, 'mean_word_length': 4.039944903581267, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 49, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2892376', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1127, 'n_words': 218}