Skip to content

Commit 5282c2e

Browse files
TomasVotrubajaapio
authored andcommitted
return test code back
1 parent 51122cf commit 5282c2e

File tree

1 file changed

+64
-65
lines changed

1 file changed

+64
-65
lines changed

tests/unit/DocBlock/Tags/DeprecatedTest.php

Lines changed: 64 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -74,71 +74,70 @@ public function testIfTagCanBeRenderedUsingSpecificFormatter(): void
7474

7575
$this->assertSame('Rendered output', $fixture->render($formatter));
7676
}
77-
//
78-
// /**
79-
// * @covers ::__construct
80-
// * @covers ::getVersion
81-
// */
82-
// public function testHasVersionNumber()
83-
// {
84-
// $expected = '1.0';
85-
//
86-
// $fixture = new Deprecated($expected);
87-
//
88-
// $this->assertSame($expected, $fixture->getVersion());
89-
// }
90-
//
91-
// /**
92-
// * @covers ::__construct
93-
// * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
94-
// * @uses \phpDocumentor\Reflection\DocBlock\Description
95-
// */
96-
// public function testHasDescription()
97-
// {
98-
// $expected = new Description('Description');
99-
//
100-
// $fixture = new Deprecated('1.0', $expected);
101-
//
102-
// $this->assertSame($expected, $fixture->getDescription());
103-
// }
104-
//
105-
// /**
106-
// * @covers ::__construct
107-
// * @covers ::__toString
108-
// * @uses \phpDocumentor\Reflection\DocBlock\Description
109-
// */
110-
// public function testStringRepresentationIsReturned()
111-
// {
112-
// $fixture = new Deprecated('1.0', new Description('Description'));
113-
//
114-
// $this->assertSame('1.0 Description', (string)$fixture);
115-
// }
116-
//
117-
// /**
118-
// * @covers ::create
119-
// * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::<public>
120-
// * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
121-
// * @uses \phpDocumentor\Reflection\DocBlock\Description
122-
// * @uses \phpDocumentor\Reflection\Types\Context
123-
// */
124-
// public function testFactoryMethod()
125-
// {
126-
// $descriptionFactory = m::mock(DescriptionFactory::class);
127-
// $context = new Context('');
128-
//
129-
// $version = '1.0';
130-
// $description = new Description('My Description');
131-
//
132-
// $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description);
133-
//
134-
// $fixture = Deprecated::create('1.0 My Description', $descriptionFactory, $context);
135-
//
136-
// $this->assertSame('1.0 My Description', (string)$fixture);
137-
// $this->assertSame($version, $fixture->getVersion());
138-
// $this->assertSame($description, $fixture->getDescription());
139-
// }
140-
141-
//
77+
78+
/**
79+
* @covers ::__construct
80+
* @covers ::getVersion
81+
*/
82+
public function testHasVersionNumber()
83+
{
84+
$expected = '1.0';
85+
86+
$fixture = new Deprecated($expected);
87+
88+
$this->assertSame($expected, $fixture->getVersion());
89+
}
90+
91+
/**
92+
* @covers ::__construct
93+
* @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription
94+
* @uses \phpDocumentor\Reflection\DocBlock\Description
95+
*/
96+
public function testHasDescription()
97+
{
98+
$expected = new Description('Description');
99+
100+
$fixture = new Deprecated('1.0', $expected);
101+
102+
$this->assertSame($expected, $fixture->getDescription());
103+
}
104+
105+
/**
106+
* @covers ::__construct
107+
* @covers ::__toString
108+
* @uses \phpDocumentor\Reflection\DocBlock\Description
109+
*/
110+
public function testStringRepresentationIsReturned()
111+
{
112+
$fixture = new Deprecated('1.0', new Description('Description'));
113+
114+
$this->assertSame('1.0 Description', (string)$fixture);
115+
}
116+
117+
/**
118+
* @covers ::create
119+
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::<public>
120+
* @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory
121+
* @uses \phpDocumentor\Reflection\DocBlock\Description
122+
* @uses \phpDocumentor\Reflection\Types\Context
123+
*/
124+
public function testFactoryMethod()
125+
{
126+
$descriptionFactory = m::mock(DescriptionFactory::class);
127+
$context = new Context('');
128+
129+
$version = '1.0';
130+
$description = new Description('My Description');
131+
132+
$descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description);
133+
134+
$fixture = Deprecated::create('1.0 My Description', $descriptionFactory, $context);
135+
136+
$this->assertSame('1.0 My Description', (string)$fixture);
137+
$this->assertSame($version, $fixture->getVersion());
138+
$this->assertSame($description, $fixture->getDescription());
139+
}
140+
142141
/**
143142
* @covers ::create
144143
* @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::<public>

0 commit comments

Comments
 (0)