@@ 76-86 (lines=11) @@ | ||
73 | $this->object->prepareMedia($media); |
|
74 | } |
|
75 | ||
76 | public function testPrepareMediaWithCustomHandler() |
|
77 | { |
|
78 | $media = new Media(); |
|
79 | $handler = $this->getCustomHandler($media); |
|
80 | $handler |
|
81 | ->expects($this->once()) |
|
82 | ->method('prepareMedia') |
|
83 | ->with($this->equalTo($media)); |
|
84 | $this->object->addHandler($handler); |
|
85 | $this->object->prepareMedia($media); |
|
86 | } |
|
87 | ||
88 | public function testSaveMediaWithDefaultHandler() |
|
89 | { |
|
@@ 104-114 (lines=11) @@ | ||
101 | $this->object->saveMedia($media); |
|
102 | } |
|
103 | ||
104 | public function testCreateMediaWithCustomHandler() |
|
105 | { |
|
106 | $media = new Media(); |
|
107 | $handler = $this->getCustomHandler($media); |
|
108 | $handler |
|
109 | ->expects($this->once()) |
|
110 | ->method('saveMedia') |
|
111 | ->with($this->equalTo($media)); |
|
112 | $this->object->addHandler($handler); |
|
113 | $this->object->saveMedia($media, true); |
|
114 | } |
|
115 | ||
116 | public function testUpdateMediaWithCustomHandler() |
|
117 | { |
|
@@ 116-126 (lines=11) @@ | ||
113 | $this->object->saveMedia($media, true); |
|
114 | } |
|
115 | ||
116 | public function testUpdateMediaWithCustomHandler() |
|
117 | { |
|
118 | $media = new Media(); |
|
119 | $handler = $this->getCustomHandler($media); |
|
120 | $handler |
|
121 | ->expects($this->once()) |
|
122 | ->method('updateMedia') |
|
123 | ->with($this->equalTo($media)); |
|
124 | $this->object->addHandler($handler); |
|
125 | $this->object->saveMedia($media); |
|
126 | } |
|
127 | ||
128 | public function testRemoveMediaWithDefaultHandler() |
|
129 | { |
|
@@ 138-148 (lines=11) @@ | ||
135 | $this->object->removeMedia($media); |
|
136 | } |
|
137 | ||
138 | public function testRemoveMediaWithCustomHandler() |
|
139 | { |
|
140 | $media = new Media(); |
|
141 | $handler = $this->getCustomHandler($media); |
|
142 | $handler |
|
143 | ->expects($this->once()) |
|
144 | ->method('removeMedia') |
|
145 | ->with($this->equalTo($media)); |
|
146 | $this->object->addHandler($handler); |
|
147 | $this->object->removeMedia($media); |
|
148 | } |
|
149 | ||
150 | public function testGetHandlerWithDefaultHandler() |
|
151 | { |