Fork me on GitHub
Subscribe 2

Ticket #374 (open task)

Create test framework+cases for fluxbb-cache

  • Created: 2011-03-24 09:46:18
  • Reported by: Reines
  • Assigned to: Franz
  • Milestone: 2.0-alpha1
  • Component: testing
  • Priority: low

We should start using unit testing for the FluxBB modules where possible. Now that we are taking a more modular approach and using OOP this is easier than before.

History

Reines 2011-03-24 09:50:59

  • Component changed from caching to testing.

Reines 2011-04-06 10:23:40

  • Owner Reines removed.

Franz 2011-11-24 22:58:51

  • Owner set to Franz.

Franz committed 2ae648e to cache master 2012-02-16 00:19:43

#374: Test correct generation of statistics (inserts, hits, misses).

Franz 2012-02-16 00:25:09

So what else should be tested here?

Is it possible to test persistance?

Comment edited 1 times (Diff)

Franz 2012-02-21 13:20:09

Jamie, you said something about testing serializers in chat. What would that look like?

Reines 2012-02-21 17:40:14

Just something to test that an object matches the original after encoding and decoding, for the Serialize, JSON, VarExport, XML, and YAML serializers.

i.e. something like the following, passing it each serializer, and a combination of strings, ints, objects, etc.

function test($value, $serializer) {
    $encoded = $serializer->encode($value);
    $decoded = $serializer->decode($value);

    // TODO: assert $encoded is a string
    // TODO: assert $value and $decoded are equal
}

This could be extended to test all the filters actually, though obviously the is string assertion is only valid for serializers.

Comment edited 1 times (Diff)